/*
 * App layer on top of assets/css/custom.css (the theme).
 * Theme colours come from --bs-* variables; change data-color-theme on <html>
 * (Blue_Theme, Aqua_Theme, Purple_Theme, Green_Theme, Cyan_Theme, Orange_Theme) to re-skin.
 */

/* base (the theme file ships Bootstrap without its body reset) */
body {
  margin: 0; font-family: var(--bs-body-font-family); font-size: var(--bs-body-font-size);
  font-weight: var(--bs-body-font-weight); line-height: var(--bs-body-line-height);
  color: var(--bs-body-color); background: var(--bs-light);
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
}
small, .small { font-size: .875em; }
h1, h2, h3, h4, h5, h6, .text-dark { color: var(--bs-heading-color) !important; }
#main-wrapper { background: var(--bs-light); min-height: 100vh; }

/* ------------------------------------------------------------ sidebar */
.left-sidebar {
  top: 0; left: 0; bottom: 0; height: 100vh; width: 270px;
  background: var(--bs-body-bg); border-right: 1px solid var(--bs-border-color);
  display: flex; flex-direction: column; z-index: 1040;
}
.brand-logo { min-height: 70px; padding: 0 24px; width: 100%; }
.brand-logo .logo-img { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--bs-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
  box-shadow: 0 6px 14px rgba(var(--bs-primary-rgb), .3);
}
.brand-text { font-weight: 700; color: var(--bs-heading-color); font-size: 15px; line-height: 1.2; }
.sidebar-close { border: 0; background: none; font-size: 22px; color: var(--bs-body-color); }
.left-sidebar .scroll-sidebar { flex: 1; height: auto; padding: 0 16px 16px; overflow-y: auto; }
#sidebarnav { margin: 0; }
.nav-small-cap {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--bs-heading-color); opacity: .55; padding: 18px 12px 6px; margin: 0;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 2px;
  border-radius: 8px; color: var(--bs-heading-color); font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s;
}
.sidebar-link i { font-size: 20px; line-height: 1; color: var(--bs-body-color); transition: color .15s; }
.sidebar-link:hover { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
.sidebar-link:hover i { color: var(--bs-primary); }
.sidebar-link.active {
  background: var(--bs-primary); color: #fff;
  box-shadow: 0 6px 14px rgba(var(--bs-primary-rgb), .25);
}
.sidebar-link.active i { color: #fff; }
.sidebar-link.active .badge { background: #fff !important; color: var(--bs-primary) !important; }
.sidebar-profile { padding: 16px; }
.sidebar-backdrop { display: none; }

/* ------------------------------------------------------------ main area */
[data-layout=vertical] body .page-wrapper { margin-left: 270px; }
.body-wrapper { padding-top: 0; min-height: 100vh; }
.body-wrapper > .container-fluid { max-width: 1440px; padding: 24px 24px 40px; }
.app-header {
  position: sticky; top: 0; z-index: 1030; background: rgba(var(--bs-light-rgb), .85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.app-header .navbar { display: flex; align-items: center; min-height: 70px; padding: 10px 24px; gap: 14px; max-width: 1440px; margin: 0 auto; flex-wrap: nowrap; }
.page-heading { font-size: 20px; font-weight: 700; }
.nav-icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--bs-body-bg);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
  color: var(--bs-heading-color); box-shadow: var(--bs-box-shadow);
}
.nav-icon-btn:hover { color: var(--bs-primary); }
.notify-dot {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--bs-danger); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-toggle { color: var(--bs-body-color); }
.dropdown-item:hover { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }

@media (max-width: 1199.98px) {
  [data-layout=vertical] body .page-wrapper { margin-left: 0; }
  .left-sidebar { transform: translateX(-100%); transition: transform .2s ease-in; box-shadow: none; }
  body.sidebar-open .left-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 1035; }
}
@media (max-width: 767.98px) {
  .body-wrapper > .container-fluid { padding: 16px 16px 32px; }
  .app-header .navbar { padding: 10px 16px; }
}

/* ------------------------------------------------------------ cards & tables */
.card { margin-bottom: 0; }
.card-header {
  background: transparent; border-bottom: 1px solid var(--bs-border-color);
  padding: 16px 24px; font-weight: 600; color: var(--bs-heading-color); font-size: 15px;
}
.card-body { padding: 24px; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--bs-body-color); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 12px 10px; border-bottom-color: var(--bs-border-color); }
.table-sm > :not(caption) > * > * { padding: 9px 10px; }
.card .table > :not(caption) > * > :first-child { padding-left: 24px; }
.card .table > :not(caption) > * > :last-child { padding-right: 24px; }
.table thead th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-heading-color);
  font-weight: 600; white-space: nowrap; background: var(--bs-light); border-bottom: 0;
}
.table td { vertical-align: middle; }
.table td .fw-semibold, .table td.fw-semibold { color: var(--bs-heading-color); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--bs-light); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 40px 16px !important; text-align: center; color: var(--bs-secondary-color); }
.progress { height: 7px; border-radius: 10px; background: var(--bs-light); }
dl dt { color: var(--bs-heading-color); font-weight: 600; }

/* stat cards */
.stat { padding: 22px 24px; height: 100%; }
.stat .label { font-size: 13px; font-weight: 500; color: var(--bs-body-color); }
.stat .value {
  font-size: clamp(1.1rem, 1.3vw, 1.45rem); font-weight: 700; margin-top: 6px; color: var(--bs-heading-color);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.stat .sub { font-size: 12px; color: var(--bs-secondary-color); margin-top: 2px; }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 24px;
}
.stat .value.text-success, .text-profit, td.text-success { color: #3f9a1d !important; }
.stat .value.text-warning { color: #c79a0b !important; }
.min-w-0 { min-width: 0; }

/* ------------------------------------------------------------ forms & buttons */
.form-label { font-weight: 600; color: var(--bs-heading-color); font-size: 13px; margin-bottom: 6px; }
.form-select { border-color: #dbe1e6; border-radius: .5rem; }
.form-control:focus, .form-select:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .12); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .form-select, .filters .form-control { width: auto; min-width: 0; }
.btn-sm { --bs-btn-padding-x: 14px; --bs-btn-padding-y: 6px; }
.btn-icon { width: 34px; height: 34px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; border-radius: 50% !important; }
td .btn-sm:has(> i:only-child) { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-success { --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
.btn-outline-secondary { --bs-btn-color: var(--bs-heading-color); --bs-btn-border-color: #dbe1e6; --bs-btn-hover-bg: var(--bs-light); --bs-btn-hover-color: var(--bs-primary); --bs-btn-hover-border-color: #dbe1e6; }
.btn-link { --bs-btn-color: var(--bs-primary); }
a { color: var(--bs-primary); }
.table a, .card a:not(.btn) { color: var(--bs-primary); }
.badge { font-weight: 600; padding: 5px 10px; border-radius: 6px; }
.alert { border: 0; border-radius: 10px; }
.alert .btn-close { margin-left: auto; position: static; padding: .5rem; }
.alert-dismissible { padding-right: 1rem; }

/* ------------------------------------------------------------ auth */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(circle at 15% 20%, rgba(var(--bs-primary-rgb), .14), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(var(--bs-secondary-rgb), .25), transparent 45%),
    var(--bs-light);
}
.auth-wrap > .alert { width: 100%; max-width: 460px; }
.auth-card { box-shadow: 0 20px 50px rgba(0, 70, 40, .1); }

/* ------------------------------------------------------------ print */
@media print {
  .left-sidebar, .app-header, .no-print, .btn, .sidebar-backdrop { display: none !important; }
  [data-layout=vertical] body .page-wrapper { margin-left: 0; }
  .body-wrapper > .container-fluid { padding: 0; max-width: none; }
  body, #main-wrapper { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* compact, equal-height filter controls */
.filters .form-select-sm, .filters .form-control-sm {
  height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; border-radius: 8px;
}
.filters .form-select-sm { padding-right: 2.25rem; }
.filters .btn-sm { height: 38px; display: inline-flex; align-items: center; gap: 4px; }
.filters .form-check-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.filters .form-check-input { margin: 0; }

/* the theme's warning yellow is too light for text on white */
.text-warning { color: #b98900 !important; }
.badge.bg-warning-subtle { color: #946d00 !important; }

/* ============================================================ seasons */
.season-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; max-width: 180px;
  border: 0; border-radius: 21px; background: var(--bs-body-bg); color: var(--bs-heading-color);
  font-weight: 600; font-size: 13px; box-shadow: var(--bs-box-shadow);
}
.season-chip > .ti:first-child { color: var(--bs-primary); font-size: 18px; }
.season-chip .ti-chevron-down { font-size: 14px; opacity: .6; }
.season-menu { min-width: 260px; max-height: 70vh; overflow-y: auto; }
.season-menu .dropdown-item.active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }

.season-hero {
  border-radius: 16px; padding: 22px 24px; color: #fff;
  background: linear-gradient(135deg, var(--bs-primary), rgba(var(--bs-primary-rgb), .78));
  box-shadow: 0 12px 28px rgba(var(--bs-primary-rgb), .25);
}
.season-hero .stat-icon { color: var(--bs-primary); }
.hero-kicker { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.hero-title { font-size: 24px; font-weight: 700; line-height: 1.2; }
.hero-sub { font-size: 13px; opacity: .85; }
.hero-budget { text-align: right; }
.hero-progress { height: 6px; border-radius: 6px; background: rgba(255,255,255,.25); overflow: hidden; }
.hero-progress > div { height: 100%; background: #fff; border-radius: 6px; }
.month-strip { display: flex; gap: 4px; }
.month-strip .m {
  flex: 1; text-align: center; font-size: 11px; font-weight: 600; padding: 3px 0; border-radius: 6px;
  background: rgba(255,255,255,.14);
}
.month-strip .m.prep { background: rgba(255,255,255,.12); }
.month-strip .m.plant { background: rgba(255,255,255,.22); }
.month-strip .m.grow { background: rgba(133,212,70,.35); }
.month-strip .m.harvest { background: rgba(242,209,90,.45); }
.month-strip .m.now { background: #fff; color: var(--bs-primary); }

.season-card.is-current { box-shadow: 0 0 0 2px var(--bs-primary), var(--bs-card-box-shadow); }
.season-card .card-footer { border-top: 1px solid var(--bs-border-color); padding: 14px 24px; }
.season-figures .lbl { font-size: 12px; color: var(--bs-secondary-color); }
.season-figures .fig { font-weight: 700; color: var(--bs-heading-color); font-variant-numeric: tabular-nums; }

/* ============================================================ dashboard bits */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-actions .qa {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bs-body-bg);
  box-shadow: var(--bs-card-box-shadow); color: var(--bs-heading-color); font-weight: 600;
}
.quick-actions .qa:hover { color: var(--bs-primary); }
.list-feed { margin: 0; padding: 0; }
.list-feed > li { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--bs-border-color); }
.list-feed > li:last-child { border-bottom: 0; }
.list-feed .t { color: var(--bs-heading-color); font-weight: 600; }
.list-feed .s { font-size: 12px; color: var(--bs-secondary-color); }
.list-feed form { display: inline; }
.feed-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bs-primary-bg-subtle); border: 2px solid var(--bs-primary); flex-shrink: 0; }
.chart-box { position: relative; height: 300px; }
.chart-box-sq { height: 300px; }
.btn-icon { width: 34px; height: 34px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ============================================================ bottom nav & quick-add sheet */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(0, 70, 40, .06);
}
.bottom-nav > a, .bottom-nav > button:not(.fab) {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; border: 0; background: none; color: var(--bs-body-color); font-size: 11px; font-weight: 600;
}
.bottom-nav i { font-size: 22px; line-height: 1; }
.bottom-nav > a.active { color: var(--bs-primary); }
.bottom-nav .dot {
  position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--bs-danger); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.bottom-nav .fab {
  justify-self: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; border: 4px solid var(--bs-light);
  background: var(--bs-primary); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(var(--bs-primary-rgb), .35);
}
.bottom-nav .fab i { font-size: 26px; }
.quick-sheet { height: auto !important; max-height: 85vh; border-radius: 20px 20px 0 0; border: 0; }
.quick-sheet .offcanvas-body { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sheet-item {
  display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; color: var(--bs-body-color);
}
.sheet-item:hover, .sheet-item:active { background: var(--bs-light); }

/* ============================================================ phones & tablets */
@media (max-width: 1199.98px) {
  body.has-app .body-wrapper > .container-fluid { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (max-width: 767.98px) {
  body { font-size: 14px; }
  .app-header .navbar { min-height: 60px; gap: 8px; }
  .page-heading { font-size: 17px; }
  .nav-icon-btn, .season-chip { height: 38px; }
  .nav-icon-btn { width: 38px; font-size: 18px; }
  .season-chip { max-width: 140px; padding: 0 10px; font-size: 12px; }
  .user-toggle .round-40 { width: 38px !important; height: 38px !important; }
  .card-header { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .card .table > :not(caption) > * > :first-child { padding-left: 16px; }
  .card .table > :not(caption) > * > :last-child { padding-right: 16px; }
  .list-feed > li { padding: 12px 16px; }

  /* stat cards: compact, two per row where the markup allows */
  .stat { padding: 14px; position: relative; }
  .stat .stat-icon { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
  .stat .d-flex.gap-3 { display: block !important; }
  .stat .label { padding-right: 36px; min-height: 30px; display: flex; align-items: center; line-height: 1.25; }
  .stat .label { font-size: 12px; }
  .stat .value { font-size: 17px; margin-top: 2px; }
  .stat .sub { font-size: 11px; }
  .stat-row { --bs-gutter-x: 10px; --bs-gutter-y: 10px; }

  .season-hero { padding: 18px; border-radius: 14px; }
  .season-hero > .d-flex > .stat-icon { display: none; }
  .hero-title { font-size: 20px; }
  .hero-budget { text-align: left; width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px;
    padding-top: 10px; border-top: 1px solid rgba(255,255,255,.2); }
  .hero-budget .hero-title { font-size: 16px; order: -1; }
  .hero-budget .hero-kicker { font-size: 11px; }
  .hero-budget .hero-sub { width: 100%; }
  .month-strip .m { font-size: 10px; }
  .quick-actions { gap: 8px; }
  .quick-actions .qa { flex-direction: column; text-align: center; gap: 6px; padding: 12px 6px; font-size: 12px; }
  .chart-box { height: 230px; }
  .chart-box-sq { height: 260px; }

  /* 16px inputs stop iOS zooming in on focus; bigger tap targets */
  .form-control, .form-select { font-size: 16px; min-height: 44px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .btn-icon, td .btn-sm:has(> i:only-child) { width: 38px; height: 38px; }

  /* entry forms: save bar sticks above the bottom navigation */
  .form-actions {
    position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 5; margin: 16px -16px -16px !important;
    padding: 12px 16px; background: rgba(255,255,255,.95); backdrop-filter: blur(6px);
    border-top: 1px solid var(--bs-border-color); border-radius: 0 0 12px 12px;
  }
  .form-actions .btn-primary { flex: 1; }

  /* filters fold away behind a "Filters" button */
  .filters.collapsible > *:not(.filter-toggle):not(.filter-actions) { display: none !important; }
  .filters.collapsible.open > *:not(.filter-toggle):not(.filter-actions) { display: flex !important; }
  .filters.collapsible.open > .form-select, .filters.collapsible.open > .form-control, .filters.collapsible.open > select, .filters.collapsible.open > input:not([type=checkbox]) {
    display: block !important; width: 100% !important;
  }
  .filters.collapsible { gap: 8px; }
  .filters.collapsible .filter-actions { margin-left: auto; }
  .filters .form-select-sm, .filters .form-control-sm { height: 44px; font-size: 16px; }

  /* list tables become stacked cards */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tbody tr {
    position: relative; padding: 12px 16px; border-bottom: 1px solid var(--bs-border-color);
  }
  .table-cards tbody tr:last-child { border-bottom: 0; }
  .card .table.table-cards > :not(caption) > * > * { padding: 3px 0 !important; border: 0; white-space: normal; }
  .card .table.table-cards > tbody > tr > td[data-label] { text-align: right; }
  .card .table.table-cards > tbody > tr > td.td-title { text-align: left; }
  .table-cards td[data-label] { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; text-align: right; }
  .table-cards td[data-label]::before {
    content: attr(data-label); grid-column: 1; grid-row: 1 / span 6; text-align: left; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); padding-top: 3px;
  }
  .table-cards td[data-label] > * { grid-column: 2; justify-self: end; }
  .table-cards td.td-title { display: block; order: -1; font-size: 15px; text-align: left; padding: 0 44px 6px 0 !important; color: var(--bs-heading-color); font-weight: 600; }
  .table-cards td.td-title::before { display: none; }
  .table-cards td.td-title > * { text-align: left; justify-self: start; }
  .table-cards td.td-title .small, .table-cards td.td-title .text-muted { font-weight: 400; }
  .table-cards tbody tr { display: flex; flex-direction: column; }
  .table-cards td.num { text-align: right; }
  .table-cards td.td-empty { display: none; }
  .table-cards td.td-check { position: absolute; right: 16px; top: 12px; width: auto; }
  .table-cards td.td-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding-top: 8px !important; }
  .table-cards td.td-actions form.d-inline-flex { flex: 1 1 100%; }
  .table-cards td.td-actions form.d-inline-flex .form-control { flex: 1; width: auto !important; }
  .table-cards td.td-full { display: block; }
  .table-cards td.empty { text-align: center !important; }
  .table-cards tr.table-active { background: var(--bs-primary-bg-subtle); }
  .table-responsive:has(> .table-cards) { overflow: visible; }

  .dropdown-menu { max-width: calc(100vw - 24px); }
  .alert { font-size: 13px; }
}
@media (max-width: 380px) {
  .season-chip span { max-width: 70px; }
  .header-title { display: none; }
}
@media print { .bottom-nav, .quick-sheet, .season-chip { display: none !important; } }

/* ============================================================ installable app / offline */
.install-banner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(135deg, var(--bs-primary), rgba(var(--bs-primary-rgb), .8)); color: #fff;
}
.install-banner[hidden] { display: none; }
.install-banner .stat-icon { width: 42px; height: 42px; font-size: 22px; }
.install-banner .fs-2 { opacity: .85; }
.install-banner .btn-light { color: var(--bs-primary); font-weight: 700; }
.install-link {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 10px;
  border: 1px dashed rgba(var(--bs-primary-rgb), .5); background: transparent; color: var(--bs-primary); font-weight: 600; font-size: 13px;
}
.install-link[hidden] { display: none; }

.outbox-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border-radius: 12px;
  background: var(--bs-warning-bg-subtle); color: #6b5300; border: 1px solid var(--bs-warning-border-subtle);
}
.outbox-bar[hidden] { display: none; }
.outbox-bar > .ti { font-size: 24px; }
.outbox-bar strong { color: #4d3c00; }
.outbox-bar.has-errors { background: var(--bs-danger-bg-subtle); border-color: var(--bs-danger-border-subtle); color: #7a1f1f; }
.outbox-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--bs-border-color); }
.outbox-item:last-of-type { border-bottom: 0; }
.outbox-item .stat-icon { width: 38px; height: 38px; font-size: 19px; }

.net-bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 1080; height: calc(28px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #3a4752; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden;
}
.net-bar span { overflow: hidden; text-overflow: ellipsis; }
.net-bar[hidden] { display: none; }
body.is-offline { padding-top: 28px; }
body.is-offline .app-header { top: 28px; }
body.is-offline .left-sidebar { top: 28px; height: calc(100vh - 28px); }
body.is-offline [href*="export=csv"], body.is-offline .season-chip { pointer-events: none; opacity: .5; }

.pwa-toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 1090; width: min(440px, calc(100vw - 24px));
  bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px;
}
.pwa-toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #1f2a3d; color: #fff;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toast-in .25s ease-out; transition: opacity .3s, transform .3s;
}
.pwa-toast span { flex: 1; }
.pwa-toast .ti { margin-right: 4px; }
.pwa-toast.ok { background: #1d5a2c; }
.pwa-toast.bad { background: #8a2323; }
.pwa-toast button { border: 0; background: rgba(255,255,255,.18); color: #fff; font-weight: 700; padding: 6px 12px; border-radius: 16px; }
.pwa-toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 1s linear infinite; }

.ios-steps { list-style: none; padding: 0; margin: 0 0 12px; }
.ios-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--bs-heading-color); }

/* launched from the home screen: respect the phone's status bar / notch */
body.is-standalone .app-header { padding-top: env(safe-area-inset-top); }
body.is-standalone .left-sidebar { padding-top: env(safe-area-inset-top); }
body.is-standalone .install-banner, body.is-standalone [data-install] { display: none !important; }

@media (max-width: 1199.98px) {
  .pwa-toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (max-width: 767.98px) {
  .outbox-bar { margin: -4px 0 12px; padding: 10px 12px; }
  .outbox-bar .btn { min-height: 34px; }
  .install-banner { padding: 12px; }
}
@media print { .install-banner, .outbox-bar, .net-bar, .pwa-toasts { display: none !important; } }

/* ============================================================ brand logo + sync button */
.brand-logo-img { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 4px 10px rgba(47, 93, 52, .25); }
.auth-logo { width: 112px; height: 112px; border-radius: 50%; box-shadow: 0 10px 24px rgba(47, 93, 52, .25); }
.sync-btn .ti { transition: color .2s; }
.sync-btn.sync-ok .ti { color: #3f9a1d; }
.sync-btn.sync-waiting .ti { color: #b98900; }
.sync-btn.sync-error .ti { color: var(--bs-danger); }
.sync-btn.sync-offline .ti { color: var(--bs-secondary-color); }
.sync-btn .notify-dot { color: #4d3c00; }
@media (max-width: 380px) { .sync-btn { display: none !important; } }
.offline-login-note:not([hidden]) { display: flex; gap: 8px; align-items: flex-start; }
.login-error[hidden], .offline-login-note[hidden] { display: none !important; }
