/* BigMountainCosts — Modern Design 2025 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  --p:        #21408f;
  --p-lt:     #2e57c0;
  --p-dk:     #162d66;
  --ac:       #2c545c;
  --ac-lt:    #3a7080;

  --bg:       #eef1f8;
  --surface:  #ffffff;
  --s2:       #f6f8fd;

  --tx:       #0d1b2a;
  --tx2:      #4a5568;
  --tx3:      #94a3b8;

  --bd:       #e2e8f0;
  --bd-lt:    #f0f4fb;

  --sh-sm: 0 1px 4px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
  --sh-md: 0 4px 20px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --sh-lg: 0 12px 40px rgba(0,0,0,.13);

  --sw: 230px;   /* sidebar width */
  --r:  10px;    /* base radius */
  --r-lg: 16px;
  --r-xl: 20px;

  /* Bootstrap overrides */
  --bs-primary: var(--p);
  --bs-primary-rgb: 33,64,143;
  --bs-body-font-family: 'Inter', system-ui, sans-serif;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--tx);
  --bs-link-color: var(--p);
  --bs-link-hover-color: var(--p-lt);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.bmc-sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sw);
  background: linear-gradient(170deg, #162d66 0%, #21408f 55%, #1e4d5a 100%);
  flex-direction: column;
  z-index: 1040;
  overflow: hidden;
}

.bmc-sidebar-logo {
  display: flex; flex-direction: column; align-items: center;
  padding: 26px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  text-decoration: none; gap: 8px;
}
.bmc-sidebar-logo img {
  width: 50px; height: 50px; border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.bmc-sidebar-logo span {
  font-size: .65rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.6);
}

.bmc-nav {
  flex: 1; padding: 14px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}

.bmc-nav-bottom {
  padding: 10px 10px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: transparent;
}

.bmc-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r);
  color: rgba(255,255,255,.65); text-decoration: none;
  font-size: .875rem; font-weight: 500;
  transition: background .18s, color .18s;
}
.bmc-nav-link i { font-size: 1.05rem; width: 18px; text-align: center; flex-shrink: 0; }
.bmc-nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.bmc-nav-link.active {
  color: var(--p); background: #fff; font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

/* ── Main wrapper ──────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .bmc-main { margin-left: var(--sw); }
}

#app-content {
  max-width: 1080px; margin: 0 auto;
  padding: 28px 24px 48px;
}

/* ── Mobile topbar ─────────────────────────────────────────────────────── */
.bmc-topbar {
  background: linear-gradient(135deg, #162d66, #21408f);
  color: #fff; padding: 13px 16px;
  align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 14px rgba(33,64,143,.3);
}
.bmc-topbar img { width: 30px; height: 30px; border-radius: 8px; }
.bmc-topbar-title { font-weight: 700; font-size: .95rem; color: #fff; }

/* ── Mobile bottom nav ─────────────────────────────────────────────────── */
.bmc-bottom-nav {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--bd);
  height: 62px; padding: 0 4px;
  justify-content: space-around; align-items: center;
  box-shadow: 0 -4px 24px rgba(0,0,0,.08); z-index: 1030;
}
.bmc-bottom-nav a {
  display: flex; flex-direction: column; align-items: center;
  color: var(--tx3); text-decoration: none;
  font-size: .58rem; font-weight: 600; letter-spacing: .03em; gap: 2px;
  padding: 5px 10px; border-radius: var(--r); flex: 1;
  transition: color .18s;
}
.bmc-bottom-nav a i { font-size: 1.2rem; display: block; }
.bmc-bottom-nav a.active { color: var(--p); }
.bmc-bottom-nav a.active i {
  background: rgba(33,64,143,.1);
  border-radius: 8px; padding: 2px 8px;
}

.pb-mobile { padding-bottom: 74px; }
@media (min-width: 768px) { .pb-mobile { padding-bottom: 0; } }

/* ── iPhone safe-area (home indicator) ─────────────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bmc-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(62px + env(safe-area-inset-bottom));
  }
  .pb-mobile {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }
}

/* ── Page headers ──────────────────────────────────────────────────────── */
.page-hdr {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 22px; gap: 12px; flex-wrap: wrap;
}
.page-title  { font-size: 1.45rem; font-weight: 800; margin: 0; color: var(--tx); }
.page-sub    { font-size: .82rem; color: var(--tx3); margin: 2px 0 0; }
.back-link   {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--tx2); font-size: .82rem; font-weight: 600;
  text-decoration: none; margin-bottom: 6px;
  transition: color .15s;
}
.back-link:hover { color: var(--p); }
.back-link i { font-size: .9rem; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: none;
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}

/* ── Accordion (Ustawienia) ────────────────────────────────────────────── */
.bmc-accordion { display: flex; flex-direction: column; gap: 12px; }
.bmc-accordion .accordion-item {
  background: var(--surface); border: none;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--sh-sm); overflow: hidden;
}
.bmc-accordion .accordion-button {
  background: var(--surface); color: var(--tx);
  font-weight: 600; font-size: .92rem;
  padding: 16px 20px; border-radius: 0 !important;
  box-shadow: none;
}
.bmc-accordion .accordion-button:not(.collapsed) {
  background: var(--surface); color: var(--tx);
  box-shadow: none;
  border-bottom: 1px solid var(--bd-lt);
}
.bmc-accordion .accordion-button::after {
  flex-shrink: 0; margin-left: auto;
}
.bmc-accordion .accordion-button:focus { box-shadow: none; }
.bmc-accordion .accordion-body { padding: 20px; }
.card-header {
  background: none; border-bottom: 1px solid var(--bd-lt);
  padding: 14px 20px; color: var(--tx3);
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }

/* ── Hero card ─────────────────────────────────────────────────────────── */
.hero-card {
  background: linear-gradient(135deg, var(--p-dk) 0%, var(--p) 55%, var(--ac) 100%);
  border-radius: var(--r-xl); padding: 28px 28px 26px;
  color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 8px 32px rgba(33,64,143,.35);
  margin-bottom: 24px;
}
.hero-card::before {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px; background: rgba(255,255,255,.06); border-radius: 50%;
}
.hero-card::after {
  content: ''; position: absolute; bottom: -70px; right: 30px;
  width: 260px; height: 260px; background: rgba(255,255,255,.04); border-radius: 50%;
}
.hero-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.65); margin-bottom: 6px;
}
.hero-value {
  font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em;
  line-height: 1; margin-bottom: 14px;
}
.hero-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-pill {
  background: rgba(255,255,255,.12); border-radius: 99px;
  padding: 4px 12px; font-size: .75rem; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}

/* ── Stat tiles ────────────────────────────────────────────────────────── */
.stat-tile {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 18px 18px 16px; box-shadow: var(--sh-sm);
  display: flex; flex-direction: column; gap: 2px;
}
.stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; margin-bottom: 10px;
}
.icon-blue  { background: rgba(33,64,143,.1); color: var(--p); }
.icon-teal  { background: rgba(44,84,92,.1);  color: var(--ac); }
.icon-green { background: rgba(16,185,129,.1); color: #10b981; }
.icon-amber { background: rgba(245,158,11,.1); color: #f59e0b; }
.icon-rose  { background: rgba(239,68,68,.1);  color: #ef4444; }
.stat-label { font-size: .72rem; font-weight: 600; color: var(--tx3); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 1.25rem; font-weight: 800; color: var(--tx); letter-spacing: -.01em; }

/* ── Category rows ─────────────────────────────────────────────────────── */
.cat-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 0; border-bottom: 1px solid var(--bd-lt);
  text-decoration: none; color: inherit; cursor: pointer;
  transition: opacity .15s;
}
.cat-row:last-child { border-bottom: none; }
.cat-row:hover { opacity: .75; }
.subcat-row { background: color-mix(in srgb, var(--bg2) 60%, transparent); padding-left: 8px; }
.subcat-indent { width: 22px; flex-shrink: 0; border-left: 2px solid var(--bd); margin-left: 4px; height: 32px; }
.subcat-card {
  background: var(--bg2); border-radius: var(--r); padding: 14px 16px;
  cursor: pointer; transition: box-shadow .18s, transform .18s;
}
.subcat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-1px); }
.subcat-card-name { font-size: .88rem; font-weight: 600; color: var(--tx); margin-bottom: 4px; }
.subcat-card-total { font-size: 1rem; font-weight: 700; color: var(--ac); }
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tx3); margin-bottom: 10px; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cat-info { flex: 1; min-width: 0; }
.cat-name { font-size: .9rem; font-weight: 600; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar { height: 4px; background: var(--bd-lt); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.cat-bar-fill { height: 100%; border-radius: 99px; transition: width .7s ease; }
.cat-amt { font-size: .9rem; font-weight: 700; color: var(--ac); flex-shrink: 0; }
.cat-pct { font-size: .7rem; color: var(--tx3); width: 34px; text-align: right; flex-shrink: 0; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn { border-radius: var(--r); font-weight: 600; font-size: .855rem; transition: all .18s; }
.btn-primary {
  background: linear-gradient(135deg, var(--p-lt), var(--p));
  border: none; color: #fff;
  box-shadow: 0 2px 10px rgba(33,64,143,.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--p), var(--p-dk));
  box-shadow: 0 4px 14px rgba(33,64,143,.38); color: #fff;
}
.btn-primary:active, .btn-primary:focus {
  outline: none; box-shadow: 0 0 0 3px rgba(33,64,143,.2); color: #fff;
}
.btn-outline-primary { color: var(--p); border-color: var(--p); background: transparent; font-size: .82rem; }
.btn-outline-primary:hover { background: var(--p); border-color: var(--p); color: #fff; }
.btn-outline-secondary { color: var(--tx2); border-color: var(--bd); background: transparent; font-size: .82rem; }
.btn-outline-secondary:hover { background: var(--s2); border-color: var(--bd); color: var(--tx); }
.btn-outline-danger { font-size: .82rem; }
.btn-outline-success { font-size: .82rem; }
.btn-sm { padding: .32rem .7rem; font-size: .78rem; }

/* ── Progress ──────────────────────────────────────────────────────────── */
.progress { background: var(--bd-lt); border-radius: 99px; overflow: hidden; }
.progress-bar {
  background: linear-gradient(90deg, var(--p-lt), var(--p));
  border-radius: 99px; transition: width .8s ease;
}

/* ── Tables ────────────────────────────────────────────────────────────── */
.table { font-size: .875rem; margin: 0; }
.table th {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--tx3);
  border-bottom: 1px solid var(--bd); padding: 10px 14px;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--bd-lt); vertical-align: middle; color: var(--tx); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table-hover tbody tr:hover td { background: var(--s2); }

/* ── Form inputs ───────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--r); border: 1.5px solid var(--bd);
  padding: 9px 14px; font-size: .875rem; color: var(--tx);
  background: var(--surface); transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--p); box-shadow: 0 0 0 3px rgba(33,64,143,.12);
  outline: none; background: var(--surface);
}
.form-label {
  font-size: .72rem; font-weight: 700; color: var(--tx2);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-content {
  border: none; border-radius: var(--r-xl); box-shadow: var(--sh-lg);
}
.modal-header { border-bottom: 1px solid var(--bd-lt); padding: 20px 24px 16px; }
.modal-title  { font-weight: 800; font-size: 1.05rem; }
.modal-body   { padding: 20px 24px; }
.modal-footer { border-top: 1px solid var(--bd-lt); padding: 16px 24px; gap: 8px; }

/* ── Date items ────────────────────────────────────────────────────────── */
.date-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--bd-lt);
}
.date-item:last-child { border-bottom: none; }
.date-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}

/* ── Note cards ────────────────────────────────────────────────────────── */
.note-card {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--sh-sm);
  border-left: 3px solid var(--p);
  transition: box-shadow .2s, transform .2s;
}
.note-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.note-description {
  white-space: pre-wrap; color: var(--tx2);
  font-size: .875rem; line-height: 1.65; margin-top: 8px;
}

/* ── Spinner / empty ───────────────────────────────────────────────────── */
.bmc-spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 80px 0; color: var(--tx3); flex-direction: column; gap: 14px;
}
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--tx3);
}
.empty-state i { font-size: 2.8rem; opacity: .35; display: block; margin-bottom: 10px; }
.empty-state p { font-size: .875rem; margin: 0; }

/* ── Toasts ────────────────────────────────────────────────────────────── */
.toast { border-radius: var(--r-lg); border: none; box-shadow: var(--sh-lg); }

/* ── Section label ─────────────────────────────────────────────────────── */
.section-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--tx3); margin-bottom: 10px;
}

/* ── Alert ─────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--r); border: none; font-size: .875rem; }
.alert-info    { background: #eff6ff; color: #1d4ed8; }
.alert-danger  { background: #fef2f2; color: #b91c1c; }

/* ── Misc ──────────────────────────────────────────────────────────────── */
.amt-accent { color: var(--ac); font-weight: 700; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-muted { color: var(--tx3) !important; }

@media (max-width: 767px) {
  #app-content  { padding: 14px 12px 28px; }
  .hero-card    { padding: 20px 18px 18px; margin-bottom: 16px; }
  .hero-value   { font-size: 1.75rem; }
  .hero-label   { font-size: .65rem; }
  .hero-pill    { font-size: .7rem; padding: 3px 10px; }
  .stat-value   { font-size: 1.05rem; }
  .stat-tile    { padding: 14px 14px 12px; }
  .stat-icon    { width: 30px; height: 30px; font-size: .85rem; margin-bottom: 8px; }
  .page-title   { font-size: 1.15rem; }
  .page-sub     { font-size: .76rem; }
  .card-header  { padding: 11px 14px; font-size: .65rem; }
  .card-body    { padding: 14px !important; }
  .note-card    { padding: 14px 16px; }
  .cat-name     { font-size: .84rem; }
  .cat-amt      { font-size: .84rem; }
  .table th, .table td { padding: 10px 10px; font-size: .82rem; }
  .btn          { font-size: .82rem; }
}
