/* ==========================================================================
   Dashboard — Professional accounting dashboard
   ========================================================================== */

/* ── Page ──────────────────────────────────────────────────────────────── */
.dashboard {
  padding: 24px 28px;
  max-width: 100%;
}

/* ── Row / Grid ────────────────────────────────────────────────────────── */
.dash-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.dash-row > .dash-col {
  flex: 1;
  min-width: 0;
}

.dash-col-6 { flex: 0 0 calc(50% - 10px); max-width: calc(50% - 10px); }
.dash-col-12 { flex: 0 0 100%; max-width: 100%; }

@media (max-width: 991px) {
  .dash-col-6 { flex: 0 0 100%; max-width: 100%; }
}

/* ── Panel ─────────────────────────────────────────────────────────────── */
.dash-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s;
}

.dash-panel:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

/* Panel Header */
.dash-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #374151;
  gap: 10px;
  letter-spacing: 0.01em;
}

.dash-panel-hd .hd-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-panel-hd .hd-title i {
  font-size: 12px;
  opacity: 0.85;
}

.dash-panel-hd .hd-amount {
  font-weight: 500;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  opacity: 0.92;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Header color variants */
.dash-panel-hd.hd-blue { background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%); }
.dash-panel-hd.hd-amber { background: linear-gradient(135deg, #92400e 0%, #b45309 100%); }
.dash-panel-hd.hd-green { background: linear-gradient(135deg, #065f46 0%, #047857 100%); }
.dash-panel-hd.hd-purple { background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%); }
.dash-panel-hd.hd-red { background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%); }
.dash-panel-hd.hd-cyan { background: linear-gradient(135deg, #075985 0%, #0284c7 100%); }
.dash-panel-hd.hd-slate { background: linear-gradient(135deg, #334155 0%, #475569 100%); }
.dash-panel-hd.hd-teal { background: linear-gradient(135deg, #115e59 0%, #0d9488 100%); }
.dash-panel-hd.hd-indigo { background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%); }

/* Panel Body */
.dash-panel-bd {
  padding: 0;
  overflow-x: auto;
}

/* ── Data Table ────────────────────────────────────────────────────────── */
.dash-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dash-tbl th {
  padding: 9px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}

.dash-tbl td {
  padding: 8px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
  white-space: nowrap;
}

.dash-tbl tbody tr:last-child td {
  border-bottom: none;
}

.dash-tbl tbody tr {
  transition: background 0.1s;
}

.dash-tbl tbody tr:hover {
  background: #f0f7ff;
}

.dash-tbl tbody tr:nth-child(even) {
  background: #fafbfc;
}

.dash-tbl tbody tr:nth-child(even):hover {
  background: #f0f7ff;
}

/* Link cells */
.dash-tbl td a {
  color: #1e40af;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.dash-tbl td a:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Right-align amounts */
.dash-tbl .r {
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Center-align */
.dash-tbl .c {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
}

/* Overdue row */
.dash-tbl tr.overdue td {
  color: #dc2626;
  background: #fef2f2;
}

.dash-tbl tr.overdue td a {
  color: #dc2626;
  font-weight: 600;
}

.dash-tbl tr.overdue:hover td {
  background: #fee2e2;
}

/* ── Table Pagination ──────────────────────────────────────────────────── */
.dash-pager {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border-top: 1px solid #f3f4f6;
  background: #fafbfc;
}

.dash-pager span,
.dash-pager a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}

.dash-pager span {
  background: #111827;
  color: #fff;
  font-weight: 600;
}

.dash-pager a {
  color: #6b7280;
}

.dash-pager a:hover {
  background: #e5e7eb;
  color: #111827;
}

/* ── Empty Panel ───────────────────────────────────────────────────────── */
.dash-empty {
  padding: 32px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dash-empty i {
  font-size: 20px;
  opacity: 0.35;
  margin-bottom: 4px;
}

/* ── Summary Row (inside panel) ────────────────────────────────────────── */
.dash-summary {
  display: flex;
  gap: 24px;
  padding: 10px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  flex-wrap: wrap;
}

.dash-summary-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.dash-summary-label {
  color: #6b7280;
  font-size: 12px;
}

.dash-summary-val {
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: #111827;
}

/* ── Stat Mini Cards ───────────────────────────────────────────────────── */
.dash-mini-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.dash-mini-stat {
  flex: 1;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s;
}

.dash-mini-stat:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: #d1d5db;
}

.dash-mini-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dash-mini-stat-icon.i-blue { background: #dbeafe; color: #1d4ed8; }
.dash-mini-stat-icon.i-amber { background: #fef3c7; color: #b45309; }
.dash-mini-stat-icon.i-green { background: #d1fae5; color: #047857; }
.dash-mini-stat-icon.i-red { background: #fee2e2; color: #b91c1c; }

.dash-mini-stat-info {
  flex: 1;
  min-width: 0;
}

.dash-mini-stat-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 2px;
}

.dash-mini-stat-val {
  font-size: 18px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  color: #111827;
  letter-spacing: -0.03em;
}

/* ── RTL ───────────────────────────────────────────────────────────────── */
[dir="rtl"] .dash-tbl th,
[dir="rtl"] .dash-tbl td { text-align: right; }
[dir="rtl"] .dash-tbl .r { text-align: left; }
[dir="rtl"] .dash-tbl .c { text-align: center; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .dashboard { padding: 16px; }
  .dash-row { flex-direction: column; gap: 14px; }
  .dash-col-6 { flex: 0 0 100%; max-width: 100%; }
  .dash-mini-stats { flex-wrap: wrap; gap: 12px; }
  .dash-mini-stat { flex: 0 0 calc(50% - 8px); }
  .dash-mini-stat-val { font-size: 15px; }
  .dash-tbl { font-size: 12px; }
  .dash-tbl th, .dash-tbl td { padding: 7px 10px; }
}

@media (max-width: 480px) {
  .dash-mini-stat { flex: 0 0 100%; }
}
