/* Globalny reset marginesów dla wszystkich stron */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
}

.container { width: 100%; margin: 24px 0; padding: 0 16px; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; gap:12px; flex-wrap: wrap; }
.alert { background:#ffe9e9; padding:10px; border-radius:8px; margin: 10px 0; }
.panel { background:#fff; padding:14px; border-radius:10px; box-shadow:0 1px 8px rgba(0,0,0,.06); }
.grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:12px; margin-top:12px; }
label { display:block; font-size: 13px; margin-top:10px; color:#333; }
input, select, textarea, button { width:100%; padding:10px; border-radius:8px; border:1px solid #d7dbe7; background:#fff; }
button { cursor:pointer; font-weight:600; }
.board { display:grid; grid-template-columns: repeat(6, 250px); gap:12px; margin-top:16px; width:max-content; min-width:100%; }
.col { background:#fff; border-radius:10px; padding:10px; box-shadow:0 1px 8px rgba(0,0,0,.06); min-height: 420px; }
.col-title { font-weight:800; font-size:12px; letter-spacing:.06em; color:#444; margin-bottom:8px; display:flex; justify-content:space-between; align-items:center; gap:8px; }
.col-list { min-height: 360px; }
.card { background:#f7f8fe; border:1px solid #e7e9f5; border-radius:10px; padding:10px; margin-bottom:8px; }
.card-title { font-weight:700; }
.card-meta { font-size: 12px; color:#555; margin-top:4px; }
.card-link { display:inline-block; margin-top:8px; font-size:13px; }
.list { margin-top:8px; }
.list-item { background:#fff; border-radius:10px; padding:10px; margin-bottom:10px; box-shadow:0 1px 8px rgba(0,0,0,.06); }
.muted { color:#666; font-size: 13px; }
.photos { display:grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap:10px; }
.photo { display:block; background:#fff; border-radius:10px; overflow:hidden; box-shadow:0 1px 8px rgba(0,0,0,.06); }
.photo img { width:100%; height:110px; object-fit:cover; display:block; }

.filters { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap:10px; align-items:end; margin: 12px 0 6px; }
.filters button { height: 42px; }

.yoy-up { border-left: 6px solid #2e7d32; background: #f1faf4; }
.yoy-down { border-left: 6px solid #c62828; background: #fff2f2; }
.yoy-nodata { border-left: 6px solid #9e9e9e; background: #f5f5f5; }

@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .board { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .board { grid-template-columns: 1fr; }
  .photos { grid-template-columns: repeat(3, minmax(0,1fr)); }
}


/* Modal */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(17,24,39,.55);
  z-index:9998;
}
.modal{
  position:fixed; inset:0;
  display:flex; align-items:center; justify-content:center;
  z-index:9999;
  padding:18px;
}
.modal-card{
  width:min(1100px, 100%);
  max-height: calc(100vh - 36px);
  overflow:auto;
  background:#fff;
  border-radius:16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
  border:1px solid #eee;
  padding:16px;
}
.modal-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
  padding-bottom:12px; border-bottom:1px solid #f1f5f9;
}
.modal-title{font-size:16px; font-weight:900; color:var(--text);}
.modal-controls{
  display:grid; grid-template-columns: 2fr 1fr 1fr auto;
  gap:12px; padding:12px 0;
}
.modal-controls label{display:block; font-weight:800; color:var(--muted); margin-bottom:6px;}
.modal-actions{display:flex; align-items:end;}
.modal-grid{display:grid; grid-template-columns: 1.2fr .8fr; gap:12px;}
@media (max-width: 980px){
  .modal-controls{grid-template-columns:1fr;}
  .modal-grid{grid-template-columns:1fr;}
}

.nav-link{color:#C1121F;font-weight:800;text-decoration:none;margin-left:14px;}
.nav-link:hover{text-decoration:underline;}


/* ===== Simple filters layout (UI05) ===== */
.filters-simple{
  display:grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap:16px;
  align-items:end;
}
.filters-simple label{
  display:block;
  font-size:12px;
  color:var(--muted, #6B7280);
  font-weight:900;
  margin-bottom:6px;
}
.filters-simple__actions{
  display:flex;
  justify-content:flex-end;
}
.filters-advanced{
  display:grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap:16px;
  align-items:end;
}
.filters-advanced.is-collapsed{
  display:grid !important;
  height:0 !important;
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  overflow:hidden !important;
  visibility:hidden;
}
@media (max-width: 1200px){
  .filters-simple{grid-template-columns: repeat(2, 1fr);}
  .filters-simple__actions{grid-column: 1 / -1;}
  .filters-advanced{grid-template-columns: repeat(2, 1fr);}
  .filters-advanced .filters-simple__actions{grid-column: 1 / -1;}
  .userbox{margin-left:0;}
}


/* ===== SaaS UI refresh (UI05c) ===== */
:root{
  --delta-red:#C1121F;
  --delta-red-600:#B0101A;
  --delta-red-700:#980D16;
  --bg:#F7F8FC;
  --panel:#FFFFFF;
  --text:#0F172A;
  --muted:#64748B;
  --border:#E2E8F0;
  --ring: rgba(193,18,31,.18);
  --shadow: 0 12px 30px rgba(2,6,23,.08);
}

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:var(--bg);
  color:var(--text);
  margin:0 !important;
  padding:0 !important;
}
a{color:var(--delta-red); text-decoration:none;}
a:hover{color:var(--delta-red-700); text-decoration:underline;}

/* Layout z sidebar – desktop domyślnie, desktop explicit w @media poniżej */
.app{
  display:flex;
  min-height:100vh;
}

:root{
  --crm-bg-primary:#0b1220;
  --crm-bg-surface:#101a2b;
  --crm-bg-surface-soft:#142035;
  --crm-text-primary:#e8eff9;
  --crm-text-muted:#9fb0c8;
  --crm-accent-primary:#e2e8f0;
  --crm-accent-soft:rgba(226,232,240,.18);
  --crm-border-primary:rgba(100,116,139,.34);
}

.sidebar{
  width:308px !important;
  min-width:308px !important;
  max-width:308px !important;
  flex-shrink:0;
  flex-grow:0;
  background:linear-gradient(180deg,var(--crm-bg-surface),var(--crm-bg-surface-soft));
  border-right:1px solid var(--crm-border-primary);
  position:sticky;
  top:0;
  left:auto;
  height:100vh;
  overflow-x:hidden;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  box-shadow:18px 0 40px rgba(2,6,23,.34);
}

/* Desktop: wymuszenie układu – zapobiega błędnemu zastosowaniu stylów mobile po Cmd+Shift+R */
@media (min-width: 769px){
  .sidebar{
    position:sticky;
    left:auto;
  }
  .app-main{
    flex:1;
    min-width:0;
  }
}

.sidebar-header{
  flex-shrink:0;
  padding:12px 16px;
  border-bottom:1px solid var(--crm-border-primary);
  background:transparent;
  min-width:0;
  overflow:hidden;
}

.sidebar-brand{
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:center; /* wyśrodkuj logo i napis w poziomie */
}
.sidebar-brand__logo{
  width:240px;
  max-width:100%;
  overflow:hidden;
}
.sidebar-brand__logo img{
  display:block;
  width:100%;
  height:auto;
  max-height:64px;
  object-fit:contain;
}
.sidebar-brand__sub{
  font-size:10px;
  font-weight:700;
  color:var(--crm-text-muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  line-height:1.2;
  margin-top:4px;
  text-align:center;
}

.sidebar-nav{
  flex:0 0 auto;
  padding:12px 12px 10px;
  display:flex;
  flex-direction:column;
  gap:0;
  min-width:0;
  --sidebar-nav-padding-x: 16px;
}

.sidebar-nav__section{
  margin:0 0 12px 0;
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:0 0 10px 0;
  border-bottom:1px solid rgba(148,163,184,.14);
}
.sidebar-nav__section:last-child{
  margin-bottom:0;
  padding-bottom:0;
  border-bottom:0;
}

.sidebar-nav__group-title{
  padding:8px 12px;
  font-size:11px;
  font-weight:900;
  line-height:1.3;
  min-height:34px;
  display:flex;
  align-items:center;
  gap:8px;
  text-transform:uppercase;
  letter-spacing:.1em;
  color:var(--crm-text-muted);
  border-left:0;
  background:rgba(148,163,184,.12);
  border-radius:0;
  overflow:hidden;
  box-sizing:border-box;
  margin-bottom:4px;
  min-width:0;
}
.sidebar-nav__group-icon{
  flex-shrink:0;
  font-size:12px;
  line-height:1;
  opacity:1;
  margin-right:0;
  width:18px;
  height:18px;
  border-radius:6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb, var(--crm-accent-primary) 18%, transparent);
  border:1px solid color-mix(in srgb, var(--crm-accent-primary) 36%, transparent);
  color:#f1f5f9;
}

.sidebar-nav__section .sidebar-nav__item{
  margin-left:0;
}

.sidebar-nav__item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  color:var(--crm-text-primary);
  text-decoration:none;
  font-size:13px;
  font-weight:700;
  transition:all .15s ease;
  border-left:0;
  border-radius:10px;
  box-sizing:border-box;
  min-width:0;
  overflow:hidden;
  margin:2px 0;
}
.sidebar-nav__item:hover{
  background:rgba(148,163,184,.16);
  color:#fff;
  text-decoration:none;
}
.sidebar-nav__item.active{
  background:rgba(148,163,184,.34);
  color:#fff;
  border-left-color:transparent;
  font-weight:700;
}

/* podświetlenie na żółto, gdy są nowe przypomnienia od innych użytkowników */
.sidebar-nav__item--reminders-new{
  background:#eab308;
  color:#0f172a;
  border-left-color:#ca8a04;
  font-weight:900;
  box-shadow:0 0 0 1px rgba(234,179,8,.5), 0 0 12px rgba(234,179,8,.4);
}
.sidebar-nav__item--reminders-new:hover{
  background:#facc15;
  color:#0f172a;
}

/* podświetlenie na żółto, gdy są nieprzeczytane nowości */
.sidebar-nav__item--news-new{
  background:#eab308;
  color:#0f172a;
  border-left-color:#ca8a04;
  font-weight:900;
  box-shadow:0 0 0 1px rgba(234,179,8,.5), 0 0 12px rgba(234,179,8,.4);
}
.sidebar-nav__item--news-new:hover{
  background:#facc15;
  color:#0f172a;
}


.sidebar-footer{
  flex:0 0 auto;
  padding:12px 16px;
  border-top:1px solid var(--crm-border-primary);
  background:transparent;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
  overflow:hidden;
}

/* Przełącznik wyglądu (Nowy / Klasyczny) — widoczny w stopce menu */
.ui-switch{
  margin:0;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.14);
}
.ui-switch__label{
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:rgba(255,255,255,.55);
  margin-bottom:8px;
}
.ui-switch__track{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:3px;
  border-radius:10px;
  background:rgba(0,0,0,.22);
}
.ui-switch__opt{margin:0;}
.ui-switch__opt button{
  width:100% !important;
  border:0 !important;
  background:transparent !important;
  color:rgba(255,255,255,.75) !important;
  font-size:13px !important;
  font-weight:700 !important;
  padding:8px 6px !important;
  border-radius:8px !important;
  cursor:pointer;
  box-shadow:none !important;
}
.ui-switch__opt.is-active button{
  background:#fff !important;
  color:#0f172a !important;
}

.sidebar-user{
  font-size:11px;
  font-weight:800;
  color:var(--crm-text-primary);
  text-align:center !important;
  margin-top:0;
  margin-bottom:0;
  display:block;
  width:100%;
  box-sizing:border-box;
}
.sidebar-user .muted{
  color:var(--crm-text-muted);
  font-weight:600;
}

.sidebar-update-dates{
  margin-top:0;
  padding-top:12px;
  border-top:1px solid var(--crm-border-primary);
  font-size:11px;
  color:#fff;
  line-height:1.4;
  margin-bottom:12px;
  min-width:0;
  overflow:hidden;
}
.sidebar-update-dates__item{
  margin-bottom:4px;
  color:#fff !important;
  overflow-wrap:break-word;
  word-wrap:break-word;
  word-break:break-word;
  max-width:100%;
}
.sidebar-update-dates__item:last-child{
  margin-bottom:0;
}
.sidebar-update-dates__item strong{
  color:#fff !important;
  font-weight:700;
}
.sidebar-update-dates__no-data{
  color:var(--crm-text-muted);
}

/* Globalny, twardy styl sidebara (żeby lokalne style stron go nie cofały) */
.sidebar{background:linear-gradient(180deg,var(--crm-bg-surface),var(--crm-bg-surface-soft)) !important; border-right:1px solid var(--crm-border-primary) !important;}
.sidebar-header{background:transparent !important; border-bottom:1px solid var(--crm-border-primary) !important;}
.sidebar-brand__sub{color:var(--crm-text-muted) !important;}
.sidebar-nav__group-title{color:var(--crm-text-muted) !important; background:transparent !important; border-left:0 !important;}
.sidebar-nav__group-icon{width:18px; height:18px; border-radius:6px; display:inline-flex; align-items:center; justify-content:center; background:color-mix(in srgb, var(--crm-accent-primary) 18%, transparent); border:1px solid color-mix(in srgb, var(--crm-accent-primary) 36%, transparent); color:#f1f5f9;}
.sidebar-nav__group-icon svg{width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;}
.sidebar-nav__group-icon svg path,.sidebar-nav__group-icon svg rect{fill:currentColor; opacity:.96;}
.sidebar-nav__item{color:var(--crm-text-primary) !important;}
.sidebar-nav__item:hover{background:rgba(148,163,184,.14) !important; color:#fff !important;}
.sidebar-nav__item.active{background:var(--crm-accent-soft) !important; border-left-color:var(--crm-accent-primary) !important; color:#fff !important;}
.sidebar-nav__item.active{background:rgba(148,163,184,.34) !important; border-left-color:transparent !important;}
.sidebar-footer{background:transparent !important; border-top:1px solid var(--crm-border-primary) !important;}
.sidebar-user{color:var(--crm-text-primary) !important;}
.sidebar-user .muted,.sidebar-update-dates__no-data{color:var(--crm-text-muted) !important;}
.sidebar-update-dates{border-top:1px solid var(--crm-border-primary) !important;}
.sidebar .sidebar-nav a.sidebar-nav__item.sidebar-nav__item--new-clients,
.sidebar .sidebar-nav a.sidebar-nav__item[href="bi_przeniesieni_do_aktywnych.php"]{
  color:#eab308 !important;
}
.sidebar .sidebar-nav a.sidebar-nav__item.sidebar-nav__item--new-clients:hover,
.sidebar .sidebar-nav a.sidebar-nav__item[href="bi_przeniesieni_do_aktywnych.php"]:hover{
  color:#facc15 !important;
  background:rgba(148,163,184,.16) !important;
  text-decoration:none !important;
}
.sidebar .sidebar-nav a.sidebar-nav__item.sidebar-nav__item--new-clients.active,
.sidebar .sidebar-nav a.sidebar-nav__item.active[href="bi_przeniesieni_do_aktywnych.php"]{
  color:#0f172a !important;
  background:rgba(234,179,8,.48) !important;
}

/*
 * Sidebar — ta sama szerokość i typografia na każdej stronie.
 * Lokalne <style> (np. contractor.php) nadpisują globalne .btn / body — to przywraca wygląd w aside.
 */
.app > aside.sidebar,
.app aside.sidebar{
  flex:0 0 308px !important;
  flex-basis:308px !important;
  flex-shrink:0 !important;
  flex-grow:0 !important;
  width:308px !important;
  min-width:308px !important;
  max-width:308px !important;
  box-sizing:border-box !important;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,sans-serif !important;
}
.sidebar .btn{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  border:1px solid var(--delta-red) !important;
  background:var(--delta-red) !important;
  color:#fff !important;
  padding:4px 10px !important;
  border-radius:6px !important;
  font-weight:800 !important;
  font-size:11px !important;
  text-decoration:none !important;
  box-shadow:0 1px 4px rgba(193,18,31,.12) !important;
  transform:none !important;
}
.sidebar .btn:hover{
  background:var(--delta-red-600) !important;
  border-color:var(--delta-red-600) !important;
  text-decoration:none !important;
  box-shadow:0 2px 8px rgba(193,18,31,.18) !important;
  transform:translateY(-1px) !important;
}
.sidebar .btn-outline{
  background:#fff !important;
  color:var(--delta-red) !important;
  border-color:var(--border) !important;
  box-shadow:0 1px 2px rgba(0,0,0,.03) !important;
}
.sidebar .btn-outline:hover{
  border-color:rgba(193,18,31,.4) !important;
  background:rgba(193,18,31,.04) !important;
}
.sidebar .btn-ghost{
  background:transparent !important;
  border-color:transparent !important;
  color:var(--delta-red) !important;
  box-shadow:none !important;
  padding:4px 8px !important;
}
.sidebar .btn-ghost:hover{
  background:rgba(193,18,31,.06) !important;
  text-decoration:none !important;
}
/* Stopka: Wyloguj / Zakończ podgląd — pełna szerokość jak w layoucie */
.sidebar .sidebar-footer > .btn{
  width:100% !important;
  justify-content:center !important;
}
.sidebar button,
.sidebar input,
.sidebar select,
.sidebar textarea{
  width:auto !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

/* Karty KPI (dashboard) – zapobieganie obcinaniu tekstu */
.kpi-card{
  min-width:0;
  overflow:visible;
}
.kpi-label,
.kpi-trend,
.kpi-value{
  min-width:0;
  overflow-wrap:break-word;
  word-wrap:break-word;
}
.kpi-trend{
  flex-wrap:wrap;
}

/* Filtry – pełny tekst (np. „Okres dla danych miesięcznych”) */
.filters > div{
  min-width:0;
}
.filters small{
  display:block;
  overflow-wrap:break-word;
  word-wrap:break-word;
  min-width:0;
  line-height:1.35;
}

.app-main{
  flex:1;
  display:flex;
  flex-direction:column;
}

.app-header{
  position:sticky; top:0; z-index:50;
  background:rgba(255,255,255,.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom:1px solid var(--border);
  padding:8px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}

.app-header__left{display:flex; align-items:center; gap:12px;}
.app-header__right{display:flex; align-items:center; gap:8px;}

.brand{display:flex; flex-direction:column; gap:0px;}
.brand__title{font-size:14px; font-weight:950; letter-spacing:-.01em; color:var(--text); line-height:1.2;}
.brand__sub{
  font-size:9px;
  font-weight:700;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.05em;
  line-height:1.2;
  margin-top:4px;
  text-align:center;
}

.badge{
  display:inline-flex; align-items:center;
  padding:1px 6px; border-radius:4px;
  background:rgba(193,18,31,.08);
  border:1px solid rgba(193,18,31,.15);
  color:var(--delta-red-700);
  font-weight:800; font-size:9px;
  margin-left:4px;
}

/* Pudełko z cytatem na stronie głównej */
.quote-box{
  background:#f8f9fa;
  border-left:3px solid #c1121f;
  color:#475569;
  padding:10px 14px;
  border-radius:6px;
  margin-bottom:8px;
  box-shadow:0 1px 3px rgba(0,0,0,0.05);
}
.quote-box__text{
  font-size:13px;
  font-weight:500;
  line-height:1.4;
  font-style:italic;
  color:#334155;
}

/* Czerwony alert z przypomnieniami pod cytatem na stronie głównej */
.reminders-alert{
  display:block;
  margin-bottom:16px;
  padding:8px 12px;
  border-radius:6px;
  background:#b91c1c;
  color:#fff;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
  box-shadow:0 0 0 1px rgba(185,28,28,.5), 0 0 12px rgba(185,28,28,.7);
}
.reminders-alert:hover{
  background:#dc2626;
  color:#fff;
}

.app-nav{display:flex; gap:4px; flex-wrap:wrap; margin-left:0;}
.nav-link{
  color:var(--text);
  font-weight:700;
  padding:4px 8px;
  border-radius:6px;
  text-decoration:none;
  font-size:11px;
  transition:all .12s ease;
}
.nav-link:hover{
  background:rgba(193,18,31,.06);
  text-decoration:none;
  color:var(--delta-red-700);
}

/* Układ pól w formularzu przypomnień – wszystkie pola jedno pod drugim,
   żeby etykiety i inputy nie nachodziły na siebie na węższych ekranach */
.reminders-grid{
  display:grid;
  grid-template-columns:1fr;
}
/* Gdy razem z klasą .grid-2 – wymuś jedną kolumnę również na szerszych ekranach,
   aby formularz przypomnień się nie rozjeżdżał i pola nie nachodziły na siebie */
.grid-2.reminders-grid{
  grid-template-columns:1fr;
}

.userbox{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.userbox__name{font-size:11px; font-weight:800; color:var(--text);}
.userbox__name .muted{color:var(--muted); font-weight:600;}
.userbox__actions{display:flex; gap:4px; flex-wrap:wrap;}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--delta-red);
  background:var(--delta-red);
  color:#fff;
  padding:4px 10px;
  border-radius:6px;
  font-weight:800;
  font-size:11px;
  text-decoration:none;
  cursor:pointer;
  transition:all .12s ease;
  box-shadow:0 1px 4px rgba(193,18,31,.12);
}
.btn:hover{background:var(--delta-red-600); border-color:var(--delta-red-600); text-decoration:none; box-shadow:0 2px 8px rgba(193,18,31,.18); transform:translateY(-1px);}
.btn:focus{outline:2px solid var(--ring); outline-offset:1px;}
.btn:active{transform:translateY(0);}

.btn-outline{
  background:#fff;
  color:var(--delta-red);
  border-color:var(--border);
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.btn-outline:hover{
  border-color:rgba(193,18,31,.4);
  background:rgba(193,18,31,.04);
  box-shadow:0 2px 4px rgba(193,18,31,.1);
}

.btn-ghost{
  background:transparent;
  border-color:transparent;
  color:var(--delta-red);
  box-shadow:none;
  padding:4px 8px;
}
.btn-ghost:hover{
  background:rgba(193,18,31,.06);
  text-decoration:none;
}

.container{flex:1; padding:20px; width:100%; margin:0;}

/* ===== RESPONSYWNOŚĆ - TELEFONY ===== */
/* Klasy pomocnicze dla widoku desktop/mobile */
.desktop-only{display:block;}
.mobile-only{display:none;}

/* Hamburger button i overlay - domyślnie ukryte */
.sidebar-toggle{
  display:none;
  position:fixed;
  top:12px;
  left:12px;
  z-index:1001;
  background:#1f2937;
  color:#fff;
  border:1px solid #374151;
  background:var(--delta-red, #C1121F);
  color:#fff;
  border:none;
  width:40px;
  height:40px;
  border-radius:8px;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.2);
  font-size:20px;
  align-items:center;
  justify-content:center;
  padding:0;
  line-height:0;
  transition:all 0.2s ease;
}
.sidebar-toggle svg{
  display:block;
  width:20px;
  height:20px;
}
.sidebar-toggle .sidebar-toggle__x{
  display:none;
}

.sidebar-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  z-index:999;
}

@media (max-width: 768px){
  .desktop-only{display:none !important;}
  .mobile-only{display:block !important;}
  
  /* Hamburger button - widoczny na mobile */
  .sidebar-toggle{
    display:flex !important;
    background:#C1121F !important;
    color:#fff !important;
    border:none !important;
  }
  body:has(.sidebar.open) .sidebar-toggle{
    left:auto;
    right:12px;
  }
  body:has(.sidebar.open) .sidebar-toggle .sidebar-toggle__bars{
    display:none;
  }
  body:has(.sidebar.open) .sidebar-toggle .sidebar-toggle__x{
    display:block;
  }
  .sidebar-toggle:hover{
    background:var(--delta-red-600, #B0101A);
    transform:scale(1.05);
  }
  .sidebar-toggle:active{
    transform:scale(0.95);
  }
  
  /* Sidebar - ukryj na telefonach, pokaż hamburger menu */
  .sidebar{
    position:fixed;
    left:-308px;
    top:0;
    z-index:1000;
    transition:left 0.3s ease;
    box-shadow:2px 0 8px rgba(0,0,0,.15);
  }
  .sidebar.open{
    left:0;
  }
  
  /* Overlay gdy sidebar otwarty */
  .sidebar-overlay.active{
    display:block;
  }
  
  /* Ukryj hamburger na desktop */
  @media (min-width: 769px){
    .sidebar-toggle{
      display:none !important;
    }
  }
  
  /* Overlay gdy sidebar otwarty */
  .sidebar-overlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    z-index:999;
  }
  .sidebar-overlay.active{
    display:block;
  }
  
  .app-main{
    width:100%;
  }
  
  .app-header{
    min-height:56px;
    padding:8px 12px 8px 64px;
    flex-wrap:wrap;
    box-sizing:border-box;
  }
  
  .app-header__left{
    flex:1;
    min-width:0;
  }
  
  .app-header__right{
    flex-wrap:wrap;
    gap:6px;
  }
  
  .app-header__right .btn{
    font-size:10px;
    padding:6px 10px;
  }

  .container{
    padding:12px;
  }
  
  .topbar{
    padding:8px 12px;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }
  
  .topbar .actions{
    width:100%;
    flex-direction:column;
  }
  
  .topbar .btn{
    width:100%;
    justify-content:center;
  }
  
  .filters-simple{
    grid-template-columns:1fr !important;
    gap:10px;
  }
  
  .filters-advanced{
    grid-template-columns:1fr !important;
    gap:10px;
  }
  
  .filters-simple__actions{
    grid-column:1 !important;
    width:100%;
  }
  
  .filters-simple__actions .btn{
    width:100%;
  }
  
  .board{
    grid-template-columns:1fr !important;
  }
  
  .col{
    min-height:0;
  }
  
  .card{
    padding:10px;
  }
  
  .card-title{
    font-size:13px;
  }
  
  .card-meta{
    font-size:11px;
  }
  
  .userbox{
    flex-direction:column;
    align-items:stretch;
    width:100%;
  }
  
  .userbox__actions{
    width:100%;
    flex-direction:column;
  }
  
  .userbox__actions .btn{
    width:100%;
  }
  
  /* Mobile lista kontrahentów */
  .mobile-list{
    margin-top:16px;
  }
  
  .mobile-contractors-list{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
  
  .mobile-card{
    transition:transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .mobile-card:active{
    transform:scale(0.98);
    box-shadow:0 1px 2px rgba(0,0,0,.08);
  }
}

@media (max-width: 640px){
  .container{
    padding:8px;
  }
  
  .app-header{
    min-height:56px;
    padding:8px 12px 8px 64px;
  }
  
  .app-header h1{
    font-size:16px;
  }
  
  .brand__title{
    font-size:12px;
  }
  
  .brand__sub{
    font-size:8px;
  }
  
  .topbar .title, .topbar .h1{
    font-size:14px;
  }
  
  .topbar .subtitle{
    font-size:8px;
  }
  
  .panel{
    padding:12px;
  }
  
  .col-head{
    padding:10px 12px;
  }
  
  .col-list{
    padding:10px;
  }
  
  .card{
    padding:8px;
  }
  
  .card-title{
    font-size:12px;
  }
  
  .card-meta{
    font-size:10px;
  }
  
  .card-foot{
    flex-direction:column;
    align-items:stretch;
  }
  
  .card-link{
    width:100%;
    text-align:center;
    margin-left:0;
  }
  
  .photos{
    grid-template-columns:repeat(2, 1fr) !important;
  }
  
  input, select, textarea{
    font-size:16px; /* Zapobiega zoom na iOS */
    padding:12px;
  }
  
  /* Mobile lista kontrahentów */
  .mobile-list{
    margin-top:16px;
  }
  
  .mobile-contractors-list{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
  
  .mobile-card{
    transition:transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .mobile-card:active{
    transform:scale(0.98);
    box-shadow:0 1px 2px rgba(0,0,0,.08);
  }
  
  .btn{
    padding:10px 14px;
    font-size:13px;
  }
  
  .modal{
    padding:8px;
  }
  
  .modal-card{
    padding:12px;
  }
  
  .modal-head{
    flex-direction:column;
    align-items:stretch;
  }
  
  .modal-controls{
    grid-template-columns:1fr !important;
  }
  
  .modal-grid{
    grid-template-columns:1fr !important;
  }
}

@media (max-width: 480px){
  .container{
    padding:6px;
  }
  
  .app-header{
    min-height:56px;
    padding:8px 12px 8px 64px;
  }
  
  .sidebar-toggle{
    width:40px;
    height:40px;
    top:8px;
    left:12px;
    background:#C1121F !important;
    color:#fff !important;
    border:none !important;
  }

  body:has(.sidebar.open) .sidebar-toggle{
    left:auto;
    right:12px;
  }

  body:has(.sidebar.open) .sidebar-toggle .sidebar-toggle__bars{
    display:none;
  }

  body:has(.sidebar.open) .sidebar-toggle .sidebar-toggle__x{
    display:block;
  }
  
  .panel{
    padding:10px;
  }
  
  .card{
    padding:6px;
  }
  
  .col-head{
    padding:8px 10px;
  }
  
  .col-list{
    padding:8px;
  }
}

/* Topbar - alternatywny format dla niektórych stron - ujednolicony z app-header */
.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; justify-content:space-between; align-items:center;
  gap:8px; flex-wrap:wrap;
  padding:6px 16px;
  background:rgba(255,255,255,.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom:1px solid var(--border);
  box-shadow:0 1px 2px rgba(0,0,0,.03);
  margin-bottom:16px;
  border-radius:0;
}
.topbar .title, .topbar .h1{
  font-size:16px; font-weight:950; letter-spacing:-.01em;
  margin:0; color:var(--text);
  line-height:1.2;
}
.topbar .subtitle, .topbar .muted{
  font-size:9px; font-weight:700; color:var(--muted);
  text-transform:uppercase; letter-spacing:.05em;
  margin-top:1px;
  line-height:1.2;
}
.topbar .actions{
  display:flex; gap:4px; flex-wrap:wrap;
}

.page-title{display:flex; justify-content:space-between; align-items:flex-end; gap:14px; margin:16px 0 14px;}
.page-title h1{margin:0; font-size:26px; font-weight:950;}
.muted{color:var(--muted);}

.panel{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:16px;
}

.input{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
}
.input:focus{
  outline:3px solid var(--ring);
  border-color:rgba(193,18,31,.45);
}

.board-wrap{
  margin-top:16px;
  overflow-x:auto;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
  width:100%;
}
@media (max-width: 1800px){ .board{grid-template-columns: repeat(6, 220px); gap:6px;} }
@media (max-width: 1600px){ .board{grid-template-columns: repeat(6, 200px); gap:6px;} }
@media (max-width: 1400px){ .board{grid-template-columns: repeat(6, 180px); gap:6px;} }
@media (max-width: 1200px){ .board{grid-template-columns: repeat(6, 160px); gap:6px;} }
@media (max-width: 900px){ .board{grid-template-columns: repeat(6, 140px); gap:4px;} }
@media (max-width: 720px){ .board{grid-template-columns: repeat(6, 120px); gap:4px;} }

.col{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 12px 28px rgba(2,6,23,.06);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:420px;
}
.col-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, rgba(193,18,31,.06), rgba(255,255,255,0));
}
.col-title{
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-weight:950;
  color:#334155;
}
.col-count{
  font-weight:950;
  font-size:12px;
  padding:4px 10px;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--border);
}
.col-list{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:280px;
  flex:1;
}
.empty{
  border:1px dashed var(--border);
  border-radius:14px;
  padding:12px;
  text-align:center;
  color:var(--muted);
  background:rgba(247,248,252,.7);
  font-weight:800;
}

.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px;
  box-shadow:0 6px 12px rgba(2,6,23,.04);
}
.card-clickable{
  cursor:pointer !important;
  transition:all 0.2s ease;
}
.card-clickable:hover{
  border-color:rgba(193,18,31,.40);
  box-shadow:0 8px 16px rgba(2,6,23,.08);
  transform:translateY(-1px);
  cursor:pointer !important;
}
.card-clickable *{
  cursor:pointer !important;
}
.card-clickable input[type="checkbox"],
.card-clickable label{
  cursor:default !important;
}

/* Karty w boardzie (kontrahenci) – miejsce na checkbox w rogu */
.card-select-label{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:9px;
  color:var(--muted);
  cursor:pointer;
  flex-shrink:0;
}

.card-select-label .contractor-select{
  width:14px;
  height:14px;
  cursor:pointer;
  flex-shrink:0;
}
.card:hover{
  border-color:rgba(193,18,31,.30);
  box-shadow:0 14px 32px rgba(2,6,23,.10);
}
.card-title{font-weight:950; margin-bottom:4px; font-size:10px; display:flex; align-items:center; gap:6px; flex-wrap:wrap;}
.card-acronym{font-size:16px; line-height:1.1; display:inline-block;}
.card-meta{color:var(--muted); font-weight:700; font-size:9px; margin:1px 0; line-height:1.3;}
.card-link-inline{font-size:8px; color:var(--delta-red); text-decoration:none; font-weight:800; margin-left:4px;}
.card-link-inline:hover{text-decoration:underline;}
.card-foot{display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:6px;}
.pill{
  display:inline-flex;
  align-items:center;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(2,6,23,.03);
  color:#334155;
  font-size:9px;
  font-weight:900;
}
.card-link{margin-left:auto; font-weight:950; padding:4px 6px; border-radius:8px; font-size:10px;}
.card-link:hover{background:rgba(193,18,31,.08); text-decoration:none;}

/* ===== Reminders page (reminders.php) ===== */
.rem-page{
  --rem-line:#e8e6e1;
  --rem-muted:#6f6d67;
  --rem-text:#1c1c1a;
  --rem-surface:#fff;
  --rem-soft:#f7f7f5;
  --rem-accent:#c1121f;
  --rem-radius:14px;
  padding-bottom:40px;
}

.rem-alert{
  margin-top:16px;
}
.rem-alert ul{
  margin:0;
  padding-left:18px;
}

.rem-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}
.rem-tab{
  display:inline-flex;
  align-items:center;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--rem-line);
  background:#fff;
  color:var(--rem-text);
  font-size:12px;
  font-weight:700;
  text-decoration:none;
  cursor:pointer;
}
.rem-tab.is-active{
  background:#1c1c1a;
  border-color:#1c1c1a;
  color:#fff;
}
.rem-tab--danger{
  color:#9b2c2c;
  border-color:#ebcfcf;
}

.rem-stats{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:12px;
  margin:18px 0 4px;
}
@media (max-width:900px){
  .rem-stats{grid-template-columns:repeat(2, minmax(0,1fr));}
}
.rem-stat{
  background:var(--rem-surface);
  border:1px solid var(--rem-line);
  border-radius:var(--rem-radius);
  padding:16px 18px;
  display:flex;
  flex-direction:column;
  gap:4px;
  position:relative;
  overflow:hidden;
}
.rem-stat::before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width:3px;
  background:#d1cec6;
}
.rem-stat--today::before{background:#3d8b57;}
.rem-stat--overdue::before{background:var(--rem-accent);}
.rem-stat--future::before{background:#5b6e8c;}
.rem-stat--delegated::before{background:#8a7a5c;}
.rem-stat__value{
  font-size:28px;
  font-weight:700;
  letter-spacing:-0.04em;
  line-height:1.1;
  color:var(--rem-text);
}
.rem-stat__label{
  font-size:12px;
  font-weight:500;
  color:var(--rem-muted);
}

.rem-composer{
  margin-top:16px;
}
.rem-composer__head{
  margin-bottom:14px;
}
.rem-composer__title{
  margin:0;
  font-size:16px;
  font-weight:800;
  letter-spacing:-0.02em;
}
.rem-composer__sub{
  margin:4px 0 0;
  font-size:13px;
  color:var(--rem-muted);
  font-weight:500;
  max-width:52ch;
}
.rem-composer__grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
@media (max-width:700px){
  .rem-composer__grid{grid-template-columns:1fr;}
}
.rem-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.rem-field--full{grid-column:1 / -1;}
.rem-field--search{position:relative;}
.rem-field label{
  font-size:12px;
  font-weight:600;
  color:var(--rem-muted);
}
.rem-field__hint{
  font-size:11px;
  color:var(--rem-muted);
  margin-top:2px;
}
.rem-composer__footer{
  margin-top:16px;
  display:flex;
  justify-content:flex-start;
}
.rem-composer__submit{
  padding:10px 18px !important;
}

.rem-search-results{
  position:absolute;
  z-index:30;
  top:calc(100% - 2px);
  left:0;
  right:0;
  background:#fff;
  border:1px solid var(--rem-line);
  border-radius:12px;
  box-shadow:0 12px 28px rgba(28,28,26,0.12);
  max-height:240px;
  overflow-y:auto;
  padding:4px;
}
.rem-search-results__item{
  display:block;
  width:100%;
  text-align:left;
  border:0;
  background:transparent;
  padding:10px 12px;
  border-radius:8px;
  font-size:13px;
  color:var(--rem-text);
  cursor:pointer;
}
.rem-search-results__item:hover{
  background:var(--rem-soft);
}
.rem-search-results__empty{
  padding:10px 12px;
  font-size:12px;
  color:var(--rem-muted);
}

.rem-section{
  margin-top:28px;
}
.rem-section__head{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
}
.rem-section__head--in-panel{
  margin-bottom:16px;
}
.rem-section__title{
  margin:0;
  font-size:15px;
  font-weight:800;
  letter-spacing:-0.02em;
  color:var(--rem-text);
}
.rem-section__count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:24px;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#eceae4;
  color:#3f3e3a;
  font-size:12px;
  font-weight:700;
}
.rem-section__count--warn{
  background:#f8e8e8;
  color:#9b2c2c;
}

.rem-empty{
  padding:18px 16px;
  border:1px dashed var(--rem-line);
  border-radius:var(--rem-radius);
  background:rgba(255,255,255,0.5);
  color:var(--rem-muted);
  font-size:13px;
  text-align:center;
}
.rem-empty--padded{padding:28px 16px;}

.rem-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.rem-card{
  display:flex;
  gap:14px;
  align-items:flex-start;
  background:var(--rem-surface);
  border:1px solid var(--rem-line);
  border-radius:var(--rem-radius);
  padding:14px 16px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.rem-card:hover{
  border-color:#d1cec6;
  box-shadow:0 1px 0 rgba(28,28,26,0.04);
}
.rem-card--today{
  border-color:#d8e5d8;
  background:#f7fbf7;
}
.rem-card--overdue{
  border-color:#ebcfcf;
  background:#fbf6f6;
}
.rem-card--new{
  box-shadow:inset 3px 0 0 var(--rem-accent);
}
.rem-card__check{
  flex-shrink:0;
  padding-top:2px;
}
.rem-card__check--spacer{
  width:22px;
}
.rem-check{
  display:inline-flex;
  cursor:pointer;
  position:relative;
}
.rem-check input{
  position:absolute;
  opacity:0;
  width:0;
  height:0;
}
.rem-check__box{
  width:22px;
  height:22px;
  border-radius:7px;
  border:1.5px solid #c5c2ba;
  background:#fff;
  display:block;
  transition:border-color .12s ease, background .12s ease;
}
.rem-check:hover .rem-check__box{
  border-color:#3d8b57;
  background:#f0faf3;
}
.rem-check input:focus-visible + .rem-check__box{
  outline:2px solid rgba(61,139,87,.35);
  outline-offset:2px;
}

.rem-card__body{
  flex:1;
  min-width:0;
}
.rem-card__top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.rem-card__note{
  font-size:14px;
  font-weight:600;
  line-height:1.45;
  color:var(--rem-text);
  letter-spacing:-0.01em;
  word-break:break-word;
}
.rem-card__date{
  flex-shrink:0;
  font-size:12px;
  font-weight:600;
  color:var(--rem-muted);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.rem-card--overdue .rem-card__date{
  color:var(--rem-accent);
}

.rem-card__meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
  margin-top:10px;
}
.rem-pill{
  display:inline-flex;
  align-items:center;
  padding:3px 8px;
  border-radius:999px;
  background:#eceae4;
  color:#3f3e3a;
  font-size:11px;
  font-weight:600;
}
.rem-pill--new{
  background:#f8e8e8;
  color:#9b2c2c;
}
.rem-pill--overdue{
  background:#f8e8e8;
  color:#9b2c2c;
}
.rem-pill--today{
  background:#e4f0e7;
  color:#2f6b45;
}
.rem-pill--contractor{
  background:#fff;
  border:1px solid var(--rem-line);
}
.rem-meta-text{
  font-size:11px;
  color:var(--rem-muted);
  font-weight:500;
}

.rem-card__actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:12px;
  align-items:center;
}
.rem-action,
button.rem-action{
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:8px;
  border:1px solid var(--rem-line);
  background:#fff;
  color:var(--rem-text);
  font-size:12px;
  font-weight:600;
  text-decoration:none;
  cursor:pointer;
  line-height:1.2;
}
.rem-action:hover{
  background:var(--rem-soft);
  text-decoration:none;
}
.rem-action--edit{
  border-color:#c9d4ea;
  color:#2f4f8a;
}
.rem-action--danger{
  border-color:#ebcfcf;
  color:#9b2c2c;
}
.rem-action-form{
  display:inline;
  margin:0;
}

.rem-edit,
.reminder-edit-form{
  display:none;
  margin-top:14px;
  padding:14px;
  background:#f8f7f4;
  border:1px solid var(--rem-line);
  border-radius:12px;
  width:100%;
  max-width:720px;
}
.rem-edit.is-open,
.reminder-edit-form.is-open{
  display:block;
}
.rem-edit__field{
  margin-bottom:10px;
}
.rem-edit__field label{
  display:block;
  font-size:12px;
  font-weight:600;
  color:var(--rem-muted);
  margin-bottom:4px;
}
.rem-edit__form textarea.reminder-edit-note,
.reminder-edit-form textarea.reminder-edit-note{
  width:100% !important;
  max-width:none !important;
  min-height:120px;
  box-sizing:border-box;
}
.rem-edit__row{
  display:flex;
  gap:12px;
  align-items:flex-end;
  flex-wrap:wrap;
}

.rem-archive{margin-top:20px;}
.rem-archive__scroll{
  overflow-x:auto;
  margin-top:4px;
}
.rem-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.rem-table th{
  padding:10px 12px;
  text-align:left;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.04em;
  text-transform:uppercase;
  color:var(--rem-muted);
  border-bottom:1px solid var(--rem-line);
  background:transparent;
  white-space:nowrap;
}
.rem-table td{
  padding:12px;
  border-bottom:1px solid var(--rem-line);
  vertical-align:top;
  color:var(--rem-text);
}
.rem-table__note{
  max-width:340px;
  word-wrap:break-word;
  line-height:1.4;
}
.rem-table__link{
  font-weight:600;
  color:var(--rem-text);
  text-decoration:none;
  border-bottom:1px solid #d8d5ce;
}
.rem-table__link:hover{color:var(--rem-accent);}
.rem-done-at{
  color:#2f6b45;
  font-weight:600;
  white-space:nowrap;
}
.rem-archive__footer{
  margin-top:14px;
  padding:10px 12px;
  background:var(--rem-soft);
  border-radius:10px;
  font-size:12px;
  color:var(--rem-muted);
}

.reminder-modal-backdrop{
  display:none;
  position:fixed;
  inset:0;
  z-index:80;
  background:rgba(28,28,26,0.45);
  align-items:center;
  justify-content:center;
  padding:20px;
}
.reminder-modal-backdrop.is-open{display:flex;}
.reminder-modal{
  background:#fff;
  border-radius:16px;
  max-width:440px;
  width:100%;
  padding:22px;
  box-shadow:0 20px 50px rgba(28,28,26,0.22);
  border:1px solid var(--rem-line);
}
.reminder-modal h3{
  margin:0 0 10px;
  font-size:18px;
  font-weight:800;
  letter-spacing:-0.02em;
  color:var(--rem-accent);
}
.reminder-modal p{
  margin:0 0 10px;
  font-size:14px;
  line-height:1.5;
  color:#3f3e3a;
}
.reminder-modal__actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  margin-top:18px;
  flex-wrap:wrap;
}
.rem-modal-danger{
  background:var(--rem-accent) !important;
  border-color:var(--rem-accent) !important;
  color:#fff !important;
}
.rem-btn-danger-ghost{
  color:#9b2c2c !important;
  border-color:#ebcfcf !important;
}

/* Legacy class hooks (inne widoki / dashboard) */
.reminder-list{list-style:none;padding:0;margin:8px 0;}
.reminder-item{
  background:#fff;
  border:1px solid var(--rem-line,#e8e6e1);
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:8px;
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.reminder-item__checkbox{flex-shrink:0;}
.reminder-item__checkbox input[type="checkbox"]{width:16px;height:16px;}
.reminder-item__body{flex:1;min-width:0;}
.reminder-item__note{font-weight:600;color:#1c1c1a;}
.reminder-item__contractor{font-weight:600;color:#1c1c1a;}
.reminder-item__date{font-size:12px;font-weight:600;color:#6f6d67;}
.reminder-item__meta{font-size:11px;font-weight:500;color:#6f6d67;}
.reminder-item--new{box-shadow:inset 3px 0 0 #c1121f;}

/* podświetlenie kolumny, gdy nad nią przeciągamy kartę */
.col-list.is-drag-over{
  border-radius:14px;
  outline:2px dashed rgba(193,18,31,.55);
  outline-offset:2px;
  background:rgba(193,18,31,.03);
}

/* ===== Import contractors pages ===== */
.grid-2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
}
@media (max-width: 900px){ .grid-2{grid-template-columns:1fr;} }

.card-linkbox{
  display:block;
  background:#fff;
  border:1px solid var(--border, #E2E8F0);
  border-radius:16px;
  padding:16px;
  box-shadow: 0 12px 28px rgba(2,6,23,.06);
  text-decoration:none;
}
.card-linkbox:hover{
  border-color: rgba(193,18,31,.30);
  box-shadow: 0 14px 32px rgba(2,6,23,.10);
  text-decoration:none;
}
.card-linkbox__title{font-weight:950; margin-bottom:6px; color: var(--text, #0F172A);}
.card-linkbox__desc{color: var(--muted, #64748B); font-weight:700; font-size:13px; line-height:1.35;}

/* ===== BI orders filters (weekly / monthly / quarterly) ===== */
.bi-om-filters{
  display:flex;
  flex-wrap:wrap;
  gap:16px 20px;
  align-items:flex-end;
  margin-bottom:24px;
}
.bi-om-filters > .bi-om-filter-field{
  flex:0 1 auto;
  min-width:0;
}
.bi-om-filters > .bi-om-filter-field--years{
  flex:1 1 240px;
}
.bi-om-filters > .bi-om-filter-field--country{
  flex:0 1 180px;
}
.bi-om-filters > .bi-om-reps{
  flex:1 1 280px;
  max-width:320px;
  min-width:0;
}
.bi-om-filters .bi-om-field-label{
  display:block;
  font-size:12px;
  font-weight:700;
  margin-bottom:4px;
  color:var(--text-muted, #64748b);
}
.bi-om-years{
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  align-items:center;
}
.bi-om-years label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  font-weight:500;
  font-size:14px;
  margin:0;
  color:inherit;
  white-space:nowrap;
}
.bi-om-reps-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:6px;
}
.bi-om-reps-list{
  display:flex;
  flex-direction:column;
  gap:6px;
  max-height:180px;
  overflow-y:auto;
  padding:10px;
  border:1px solid var(--border, #e2e8f0);
  border-radius:8px;
  background:var(--bg-muted, #f8fafc);
}
.bi-om-reps-list label{
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  font-weight:500;
  font-size:14px;
  margin:0;
  color:inherit;
}
.bi-om-filter-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  flex:0 0 auto;
}
.bi-om-filters input[type="checkbox"],
.bi-om-filters input[type="radio"]{
  width:auto;
  padding:0;
  margin:0;
  flex-shrink:0;
}
.bi-om-filters select.input{
  width:100%;
  max-width:100%;
}
.bi-om-filters button,
.bi-om-filters .btn{
  width:auto;
}

/* ===== BI doors model picker ===== */
.bi-doors-filters{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  align-items:flex-end;
}
.bi-doors-filters > div{
  flex:0 1 auto;
  min-width:0;
}
.bi-doors-filters .bi-doors-field-label{
  display:block;
  font-size:12px;
  font-weight:700;
  margin:0 0 4px;
  color:var(--text-muted, #64748b);
}
.bi-doors-filters .input{
  width:auto;
  min-width:150px;
}
.bi-doors-filters select.input{
  width:100%;
  min-width:200px;
}
.bi-doors-filters button,
.bi-doors-filters .btn{
  width:auto;
}
.bi-doors-filter-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:flex-end;
  margin-left:auto;
}
.bi-models-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:10px;
  margin-bottom:16px;
}
.bi-models-grid--groups{
  grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
}
.bi-model-check{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--border, #e2e8f0);
  border-radius:12px;
  background:rgba(59,130,246,.02);
  margin:0;
  min-width:0;
  cursor:pointer;
  font-size:14px;
  color:inherit;
}
.bi-model-check input[type="checkbox"]{
  width:auto;
  padding:0;
  margin:0;
  flex-shrink:0;
  transform:translateY(1px);
}
.bi-model-chip{
  width:10px;
  height:10px;
  border-radius:999px;
  background:#000;
  flex:0 0 auto;
}
.bi-model-check .bi-model-label{
  flex:1;
  min-width:0;
  font-weight:900;
}
