/*
 * ============================================================================
 * Copyright (c) 2026 ATH SOLUTIONS (PTY) LTD. All rights reserved.
 * KwaZulu-Natal, Republic of South Africa.
 * ============================================================================
 *
 * @BEGIN Developer Log Header Block
 * @FILENAME: card.css
 * @TITLE: PATHWRITE
 * @DESCRIPTION: Card and stat-card components.
 * @AUTHOR: Ary van der Pijl
 * @COMPANY: ATH SOLUTIONS (PTY) LTD
 * @WEBSITE: https://www.ath.solutions/
 * @EMAIL: info@ath.solutions
 * @COPYRIGHT: All Rights Reserved
 * @LICENSE: ATH SOLUTIONS - PROPRIETARY SOFTWARE LICENCE AGREEMENT (https://www.ath.solutions/documents/ath_solutions_software_licence_agreement.pdf)
 *
 * BEGIN CHANGELOG
 * @IMPORTANT NOTICE: Developers working on these files MUST update and maintain the Developers Change Log, failure to do is not an option:
 * !==================================================================================================================================================================
 * VERSION 1.0.2
 * - File Modified | Ary van der Pijl | 2026-09-03 | Gap Analysis v4.0 §4.0: added .stat-change .material-icons-round (14px, was inline style="font-size:14px") and .nav-item--card (color/hover overrides for .nav-item when reused as a plain card-body link outside the sidebar, was inline style="color:..." on both the link and its icon) - same class of hard-constraint fix as VERSION 1.0.1's .stat-icon--* variants, found while fixing dashboard.php. |
 * VERSION 1.0.1
 * - File Modified | Ary van der Pijl | 2026-08-15 | Added .stat-icon--success/--warning/--info colour variants - replaces the repeated inline style="background:var(--color-*-bg);color:var(--color-*)" (hard-constraint violation) found on stat-card icons across dashboard.php and admin/finance.php during the multi-language retrofit. |
 * VERSION 1.0.0
 * + File Created | Ary van der Pijl | 2026-08-06 | Extracted from main.css as part of the Phase 17 CSS architecture split (9-file hierarchy per STD-E). |
 * ==================================================================================================================================================================!
 * END CHANGELOG
 */

/* ─── Cards ──────────────────────────────────────────────────────────────── */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-4);
}

.card-title {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  margin: 0;
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ─── Stat Cards ─────────────────────────────────────────────────────────── */

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .material-icons-round {
  font-size: 24px;
}

.stat-icon--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.stat-icon--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.stat-icon--info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

/* .nav-item's own default color (layout.css) is --sidebar-text, meant for the dark sidebar
   background - wrong contrast when that same class is reused as a plain link inside a card body
   (e.g. dashboard.php's Quick Actions list). Modifier class replaces the inline
   style="color:var(--color-text)" hard-constraint violation this reuse used to need. */
.nav-item--card {
  color: var(--color-text);
}

.nav-item--card .material-icons-round {
  color: var(--color-primary);
}

.nav-item--card:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  line-height: 1;
  margin: 0 0 var(--space-1);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.stat-change {
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-change .material-icons-round {
  font-size: 14px;
}

.stat-change.up {
  color: var(--color-success);
}

.stat-change.down {
  color: var(--color-danger);
}

