/* ==========================================================================
   DeltaSmart Workflow — Application Styles
   All values reference design tokens from design-tokens.css.
   No hardcoded colors, spacing, or typography values.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base Overrides
   -------------------------------------------------------------------------- */

body {
  background-color: var(--ds-surface-body);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  border: none;
  box-shadow: var(--ds-shadow-sm);
  background-color: var(--ds-surface-card);
  border-radius: var(--ds-radius-lg);
}

.card-header {
  background-color: var(--ds-surface-card);
  border-bottom: 1px solid var(--ds-border-default);
}

/* --------------------------------------------------------------------------
   Dashboard Stats
   -------------------------------------------------------------------------- */

.stat-card {
  transition: transform var(--ds-duration-fast) var(--ds-ease-default);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  font-size: var(--ds-font-size-3xl);
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Kanban Board — styles moved to kanban.css (loaded per-page)
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Activity Feed
   -------------------------------------------------------------------------- */

.activity-item {
  padding: var(--ds-space-2) 0;
  border-bottom: 1px solid var(--ds-border-muted);
  font-size: var(--ds-font-size-base);
}

.activity-item:last-child {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table th {
  font-weight: var(--ds-font-weight-semibold);
  font-size: var(--ds-font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ds-text-muted);
}

/* --------------------------------------------------------------------------
   Login Page
   -------------------------------------------------------------------------- */

.login-container {
  max-width: 400px;
  margin: 10vh auto;
}

/* --- Redesigned Login Page (Phase 19) --- */

.ds-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.ds-login-container {
  width: 100%;
  max-width: 420px;
  padding: var(--ds-space-4);
}

.ds-login-brand {
  text-align: center;
  margin-bottom: var(--ds-space-8);
}

.ds-login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--ds-radius-xl);
  background: linear-gradient(135deg, var(--ds-brand-primary), var(--ds-brand-accent));
  color: var(--ds-text-on-primary);
  font-size: var(--ds-font-size-3xl);
  margin-bottom: var(--ds-space-3);
  box-shadow: var(--ds-shadow-md);
}

.ds-login-title {
  font-size: var(--ds-font-size-2xl);
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-text-primary);
  margin: 0 0 var(--ds-space-1) 0;
}

.ds-login-subtitle {
  font-size: var(--ds-font-size-base);
  color: var(--ds-text-muted);
  margin: 0;
}

.ds-login-card {
  background-color: var(--ds-surface-card);
  border-radius: var(--ds-radius-xl);
  box-shadow: var(--ds-shadow-lg);
  padding: var(--ds-space-8);
  border: 1px solid var(--ds-border-default);
}

.ds-login-card-header {
  margin-bottom: var(--ds-space-6);
}

.ds-login-card-title {
  font-size: var(--ds-font-size-xl);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-text-primary);
  margin: 0 0 var(--ds-space-1) 0;
}

.ds-login-card-desc {
  font-size: var(--ds-font-size-sm);
  color: var(--ds-text-muted);
  margin: 0;
}

.ds-login-form {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-4);
}

.ds-login-field {
  display: flex;
  flex-direction: column;
}

.ds-login-submit {
  width: 100%;
  padding: var(--ds-space-2-5) var(--ds-space-4);
  font-weight: var(--ds-font-weight-semibold);
  margin-top: var(--ds-space-2);
}

.ds-login-footer {
  text-align: center;
  font-size: var(--ds-font-size-xs);
  color: var(--ds-text-disabled);
  margin-top: var(--ds-space-6);
}

/* --------------------------------------------------------------------------
   Error Pages (Phase 19)
   -------------------------------------------------------------------------- */

.ds-error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: var(--ds-space-8);
}

.ds-error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--ds-radius-full);
  font-size: 2rem;
  margin-bottom: var(--ds-space-6);
}

.ds-error-icon--danger {
  background-color: var(--ds-danger-subtle);
  color: var(--ds-danger);
}

.ds-error-icon--warning {
  background-color: var(--ds-warning-subtle);
  color: var(--ds-warning);
}

.ds-error-icon--info {
  background-color: var(--ds-info-subtle);
  color: var(--ds-info);
}

.ds-error-code {
  font-size: 4rem;
  font-weight: var(--ds-font-weight-extrabold);
  color: var(--ds-text-primary);
  line-height: 1;
  margin: 0 0 var(--ds-space-2) 0;
}

.ds-error-title {
  font-size: var(--ds-font-size-xl);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-text-primary);
  margin: 0 0 var(--ds-space-3) 0;
}

.ds-error-message {
  font-size: var(--ds-font-size-base);
  color: var(--ds-text-muted);
  max-width: 420px;
  margin: 0 0 var(--ds-space-6) 0;
}

.ds-error-actions {
  display: flex;
  gap: var(--ds-space-3);
}

/* --------------------------------------------------------------------------
   Report Hub Cards (Phase 19)
   -------------------------------------------------------------------------- */

.ds-report-card {
  background-color: var(--ds-surface-card);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-sm);
  border: 1px solid var(--ds-border-default);
  transition: transform var(--ds-duration-fast) var(--ds-ease-default),
              box-shadow var(--ds-duration-fast) var(--ds-ease-default);
}

.ds-report-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ds-shadow-md);
}

.ds-report-card-body {
  padding: var(--ds-space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ds-report-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--ds-radius-xl);
  font-size: 1.5rem;
  margin-bottom: var(--ds-space-4);
}

.ds-report-card-icon--primary {
  background-color: var(--ds-brand-primary-subtle);
  color: var(--ds-brand-primary);
}

.ds-report-card-icon--info {
  background-color: var(--ds-info-subtle);
  color: var(--ds-info);
}

.ds-report-card-icon--warning {
  background-color: var(--ds-warning-subtle);
  color: var(--ds-warning);
}

.ds-report-card-icon--success {
  background-color: var(--ds-success-subtle);
  color: var(--ds-success);
}

.ds-report-card-icon--danger {
  background-color: var(--ds-danger-subtle);
  color: var(--ds-danger);
}

.ds-report-card-title {
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-text-primary);
  margin: 0 0 var(--ds-space-2) 0;
}

.ds-report-card-desc {
  font-size: var(--ds-font-size-sm);
  color: var(--ds-text-muted);
  margin: 0 0 var(--ds-space-4) 0;
  flex-grow: 1;
}

/* --------------------------------------------------------------------------
   Section Titles (Phase 19)
   -------------------------------------------------------------------------- */

.ds-section-title {
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-text-primary);
  display: flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Stock Alerts
   -------------------------------------------------------------------------- */

.alert-stock {
  border-left: 4px solid var(--ds-danger);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: var(--ds-space-12);
  color: var(--ds-text-muted);
}

.empty-state i {
  font-size: var(--ds-font-size-3xl);
  margin-bottom: var(--ds-space-4);
  display: block;
}

/* --------------------------------------------------------------------------
   Page Header & Breadcrumbs
   -------------------------------------------------------------------------- */

.ds-page-header {
  margin-bottom: var(--ds-space-6);
}

.ds-breadcrumb {
  margin-bottom: var(--ds-space-2);
}

.ds-breadcrumb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-1);
  font-size: var(--ds-font-size-sm);
}

.ds-breadcrumb-item {
  display: flex;
  align-items: center;
}

.ds-breadcrumb-item + .ds-breadcrumb-item::before {
  content: "\F285"; /* bi-chevron-right */
  font-family: "bootstrap-icons";
  font-size: 0.65rem;
  color: var(--ds-text-disabled);
  margin-right: var(--ds-space-1);
}

.ds-breadcrumb-link {
  color: var(--ds-text-muted);
  text-decoration: none;
  transition: color var(--ds-duration-fast) var(--ds-ease-default);
  display: flex;
  align-items: center;
  gap: var(--ds-space-1);
}

.ds-breadcrumb-link:hover {
  color: var(--ds-brand-primary);
}

.ds-breadcrumb-link i {
  font-size: var(--ds-font-size-sm);
}

.ds-breadcrumb-current {
  color: var(--ds-text-secondary);
  font-weight: var(--ds-font-weight-medium);
}

/* Ref breadcrumb — the referring page in navigation context */
.ds-breadcrumb-ref {
  color: var(--ds-brand-primary);
  font-weight: var(--ds-font-weight-medium);
}

.ds-page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--ds-space-4);
}

.ds-page-title-group {
  min-width: 0;
  flex: 1;
}

.ds-page-title {
  font-size: var(--ds-font-size-2xl);
  font-weight: var(--ds-font-weight-bold);
  line-height: var(--ds-line-height-tight);
  color: var(--ds-text-primary);
  margin: 0;
}

.ds-page-subtitle {
  font-size: var(--ds-font-size-base);
  color: var(--ds-text-muted);
  margin: var(--ds-space-1) 0 0 0;
}

.ds-page-actions {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Mobile: stack title and actions */
@media (max-width: 767.98px) {
  .ds-page-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ds-page-title {
    font-size: var(--ds-font-size-xl);
  }

  .ds-page-actions {
    margin-top: var(--ds-space-3);
  }
}

/* --------------------------------------------------------------------------
   Legacy Navbar Override (kept for non-authenticated pages or fallback)
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Utility: Focus Ring
   Consistent brand-colored focus indicator for accessibility.
   -------------------------------------------------------------------------- */

.form-control:focus,
.form-select:focus {
  border-color: var(--ds-brand-primary);
  box-shadow: 0 0 0 0.2rem var(--ds-brand-primary-subtle);
}
