/* modules/reports/reports.css
   Standalone stylesheet for Reports. Built from scratch - no evidence
   of an existing reports.css was found anywhere (no <link> tag in
   index.html, unlike fleet.css/customers.css which both had one),
   so this follows the same one-file-per-module convention and matches
   the dark palette + light-mode pattern already established in those
   files rather than inventing a new visual language.

   REDESIGN (per direct request - Reports layout grammar): this is the
   actual fix behind most of "Reports looks like a debug dump" - the
   .reports-* classes in reports.js had no CSS backing them at all
   before this file existed, so every stat, column, and list rendered
   as unstyled default text. Tiles (.reports-tile) deliberately mirror
   .fleet-summary-card / .stock-summary-card's exact visual language
   (same radius, same weight hierarchy) rather than a new tile design,
   so Reports finally shares the same grammar as the rest of the app.
*/

.reports-view {
  display: grid;
  gap: 18px;
}

.reports-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.reports-header h2 {
  margin: 0 0 4px;
  color: #e2e8f0;
}

.reports-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reports-period-select {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
}

/* Tabs */
.reports-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 0;
}

.reports-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
}

.reports-tab-btn:hover {
  color: #cbd5e1;
  background: #0f172a;
}

.reports-tab-btn.is-active {
  color: #e2e8f0;
  border-bottom-color: #38bdf8;
  background: #0f172a;
}

.reports-loading,
.reports-empty {
  border: 1px dashed #334155;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  background: #0f172a;
}

.reports-body {
  display: grid;
  gap: 18px;
}

.reports-section {
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 18px;
  background: #0f172a;
}

.reports-section h3 {
  margin: 0 0 14px;
  color: #e2e8f0;
  font-size: 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.reports-section h4 {
  margin: 0 0 10px;
  color: #94a3b8;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.reports-section-sub {
  color: #64748b;
  font-size: 12px;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
}

/* Tiles - deliberately mirrors .fleet-summary-card / .stock-summary-card */
.reports-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.reports-tile {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.reports-tile span {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.reports-tile strong {
  font-size: 24px;
  color: #e2e8f0;
  line-height: 1.15;
}

.reports-tile small {
  color: #94a3b8;
  font-size: 12px;
}

.reports-tile-primary {
  border-color: #38bdf8;
}

.reports-tile-primary strong {
  color: #38bdf8;
}

.reports-tile-muted {
  opacity: .7;
}

.reports-tile.is-info strong { color: #38bdf8; }
.reports-tile.is-warning strong { color: #facc15; }
.reports-tile.is-danger strong { color: #f87171; }

/* Columns of ranked lists / detail lists */
.reports-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reports-feed {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.reports-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #020617;
  font-size: 13px;
  color: #cbd5e1;
}

.reports-list-row strong {
  color: #e2e8f0;
}

.reports-list-empty {
  padding: 14px;
  color: #64748b;
  font-size: 13px;
  border: 1px dashed #334155;
  border-radius: 10px;
}

.reports-more {
  text-align: center;
  color: #64748b;
  font-size: 12px;
  padding: 6px;
}

@media (max-width: 820px) {
  .reports-columns {
    grid-template-columns: 1fr;
  }

  .reports-tabs {
    overflow-x: auto;
  }
}

/* ============================================================
   LIGHT MODE
============================================================ */
body.light-mode .reports-header h2 {
  color: #0f172a !important;
}

body.light-mode .reports-period-select {
  background: #ffffff !important;
  border-color: #d1d5db !important;
  color: #0f172a !important;
}

body.light-mode .reports-tab-btn {
  color: #64748b !important;
}

body.light-mode .reports-tab-btn:hover {
  color: #334155 !important;
  background: #f8fafc !important;
}

body.light-mode .reports-tab-btn.is-active {
  color: #0f172a !important;
  border-bottom-color: #0369a1 !important;
  background: #f8fafc !important;
}

body.light-mode .reports-loading,
body.light-mode .reports-empty {
  background: #f8fafc !important;
  color: #475569 !important;
}

body.light-mode .reports-section {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
}

body.light-mode .reports-section h3 {
  color: #0f172a !important;
}

body.light-mode .reports-section h4 {
  color: #64748b !important;
}

body.light-mode .reports-tile {
  background: #f8fafc !important;
  border-color: #e5e7eb !important;
}

body.light-mode .reports-tile strong {
  color: #0f172a !important;
}

body.light-mode .reports-tile-primary {
  border-color: #0369a1 !important;
}

body.light-mode .reports-tile-primary strong {
  color: #0369a1 !important;
}

body.light-mode .reports-tile.is-info strong { color: #0369a1 !important; }
body.light-mode .reports-tile.is-warning strong { color: #b45309 !important; }
body.light-mode .reports-tile.is-danger strong { color: #b91c1c !important; }

body.light-mode .reports-list-row {
  background: #f8fafc !important;
  border-color: #e5e7eb !important;
  color: #334155 !important;
}

body.light-mode .reports-list-row strong {
  color: #0f172a !important;
}

body.light-mode .reports-list-empty {
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}
