/* =====================================================================
   Sportix Sale Management - styles
   Works with Bootstrap 5.3 light & dark mode (data-bs-theme).
   ===================================================================== */

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --brand: #4f46e5;
}
[data-bs-theme="dark"] {
  --sidebar-bg: #0b1020;
  --sidebar-hover: #182035;
}

body { background: var(--bs-tertiary-bg); font-size: .925rem; }

.app-wrap { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); color: #cbd5e1;
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column;
  z-index: 1040; transition: transform .2s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem;
  color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand img { max-height: 34px; max-width: 60px; object-fit: contain; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex: none;
}
.brand-text { font-weight: 700; line-height: 1.15; font-size: .95rem; }
.sidebar-nav { padding: .75rem .6rem; flex: 1; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; margin-bottom: 2px;
  color: #cbd5e1; text-decoration: none; border-radius: 8px;
}
.sidebar-nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active { background: var(--brand); color: #fff; }
.sidebar-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255,255,255,.07); font-size: .85rem; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center;
  padding: .6rem 1.25rem; background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color);
}
.topbar-title { font-size: 1rem; }
.content { padding: 1.25rem; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1030;
  }
  .main { margin-left: 0; }
  .content { padding: 1rem .75rem; }
}

/* ---------- Notification bell ---------- */
.notif-menu { width: 360px; max-width: calc(100vw - 24px); }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item:hover { background: var(--bs-tertiary-bg); }

/* ---------- Cards & stats ---------- */
.card { border: 1px solid var(--bs-border-color); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: transparent; font-weight: 600; }
.stat-card .stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); }
.stat-card .stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-icon {
  width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex: none;
}
.chart-box { position: relative; height: 260px; }

/* ---------- Tables ---------- */
.table-sm td, .table-sm th { white-space: nowrap; vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .02em; color: var(--bs-secondary-color); }
.table tfoot td, .table tfoot th { font-weight: 700; background: var(--bs-secondary-bg); }
.conv { color: var(--bs-secondary-color); font-style: italic; }  /* converted (not original) currency */
.money-neg, .text-loss { color: var(--bs-danger) !important; }
.text-profit { color: var(--bs-success) !important; }

/* ---------- Forms ---------- */
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .25rem; }
.calc-box { background: var(--bs-secondary-bg); border-radius: 10px; padding: 1rem; }
.calc-box .calc-row { display: flex; justify-content: space-between; padding: .2rem 0; }
.calc-box .calc-row + .calc-row { border-top: 1px dashed var(--bs-border-color); }
.filter-bar .form-control, .filter-bar .form-select { font-size: .85rem; }
.flatpickr-input[readonly] { background-color: var(--bs-body-bg); }
[data-bs-theme="dark"] .flatpickr-calendar { background: #1e293b; box-shadow: 0 4px 16px rgba(0,0,0,.5); }
[data-bs-theme="dark"] .flatpickr-calendar .flatpickr-day,
[data-bs-theme="dark"] .flatpickr-calendar .flatpickr-weekday,
[data-bs-theme="dark"] .flatpickr-calendar .flatpickr-month,
[data-bs-theme="dark"] .flatpickr-calendar .cur-month,
[data-bs-theme="dark"] .flatpickr-calendar .numInput { color: #e2e8f0; fill: #e2e8f0; }
[data-bs-theme="dark"] .flatpickr-day:hover { background: #334155; }
[data-bs-theme="dark"] .flatpickr-months .flatpickr-prev-month svg,
[data-bs-theme="dark"] .flatpickr-months .flatpickr-next-month svg { fill: #e2e8f0; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 400px; }

/* ---------- Print (reports as PDF via browser print) ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; color: #000 !important; font-size: 11px; }
  .sidebar, .topbar, .sidebar-backdrop, .no-print, .btn, form.filter-bar, .alert, .pagination { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #bbb !important; break-inside: avoid; }
  .table { color: #000 !important; }
  .table td, .table th { padding: .2rem .35rem !important; }
  .print-header { border-bottom: 2px solid #000; margin-bottom: 10px; padding-bottom: 6px; }
  a { color: #000 !important; text-decoration: none !important; }
  .chart-box { height: 200px; }
  .table-responsive { overflow: visible !important; }
  .col-print-6 { width: 50% !important; float: left; }
}
