/* =====================================================================
   Tensoft – motyw „modern” (Help Desk i kolejne produkty)
   Inspiracja: jasne dashboardy SaaS – dużo bieli, cienkie obramowania,
   duże promienie, kolorowe kafelki ikon, font Poppins.
   Samodzielny arkusz: NIE wymaga styles.css.
   Kolejność: bootstrap.css → responsive.css → theme-modern.css
   Aktywacja: <body class="app-body theme-modern">
   ===================================================================== */

.theme-modern {
  /* --- typografia --- */
  --m-font:          "Poppins", "Segoe UI", system-ui, sans-serif;

  /* --- powierzchnie --- */
  --m-bg:            #f8f9fb;
  --m-surface:       #ffffff;
  --m-border:        #e9ebef;
  --m-divider:       #eef0f3;
  --m-th:            #f2f4f6;
  --m-hover:         #f5f6f8;
  --m-nav-active:    #eef2f5;

  /* --- tekst --- */
  --m-text:          #0c0d0d;
  --m-text-2:        #4a4f58;
  --m-muted:         #8b909a;

  /* --- akcenty --- */
  --m-primary:       #1f4ef5;
  --m-primary-hover: #1740d6;
  --m-primary-soft:  #eef2ff;
  --m-lavender:      #a09fea;
  --m-lavender-soft: #dedcff;
  --m-purple:        #5242d7;
  --m-little-purple: #e8e9ff;

  /* czerwień marki - strzałka powrotu, znak w zwiniętym sidebarze */
  --m-brand:         #de3232;
  --m-brand-hover:   #c22a2a;
  --m-brand-focus:   0 0 0 3px rgba(222, 50, 50, 0.28);

  /* kolory przycisków zarządzania plikiem (odczytane ze wzoru) */
  --m-gold:          #f2bb13;
  --m-gold-hover:    #d9a60c;
  --m-navy:          #08114d;
  --m-navy-hover:    #121d6b;

  /* --- kafelki ikon --- */
  --m-tile-coral:    #fa6a6b;
  --m-tile-orange:   #ff8a66;
  --m-tile-teal:     #1cc0c0;
  --m-tile-blue:     #1d9fff;

  /* --- stany --- */
  --m-green:         #45c88a;
  --m-red:           #f64850;
  --m-amber:         #f5a524;
  --m-gray-dot:      #b8bcc4;

  --m-radius-sm:     8px;
  --m-radius:        10px;
  --m-radius-lg:     16px;
  --m-focus:         0 0 0 3px rgba(31, 78, 245, 0.18);

  /* --- zmienne używane przez responsive.css --- */
  --ts-light:        var(--m-bg);
  --ts-text:         var(--m-text);
  --ts-muted:        var(--m-muted);
  --ts-border:       var(--m-border);
  --ts-accent:       var(--m-primary);
  --ts-row-pink:     #fff;
  --ts-row-done:     #fff;
  --ts-card-radius:  var(--m-radius-lg);

  margin: 0;
  font-family: var(--m-font);
  font-size: 14px;
  color: var(--m-text);
  background: var(--m-bg);
  -webkit-font-smoothing: antialiased;
}
.theme-modern #remository {
	position: relative;
	background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-lg);
  padding: 2rem;
}
.theme-modern button, .theme-modern input, .theme-modern select { font-family: inherit; }
.theme-modern :focus-visible { outline: 0; box-shadow: var(--m-focus); }

/* =========================== Szkielet =========================== */
.theme-modern .app { display: flex; height: 100dvh; background: var(--m-bg); }
.theme-modern .main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.theme-modern .content { flex: 1; overflow: auto; padding: 28px 32px 32px; }

/* =========================== Sidebar =========================== */
/* background-image, bo Bootstrap w .offcanvas-lg/xl wymusza background-color: transparent !important */
.theme-modern .sidebar {
  width: 264px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background-image: linear-gradient(#fff, #fff);
  border-right: 1px solid var(--m-border);
  padding: 0 18px 22px;
  transition: width .2s ease, padding .2s ease;
}
.theme-modern .brand {
  height: 140px; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px;
}
.theme-modern .brand-mark {
  display: none; place-items: center;   /* widoczny tylko po zwinięciu sidebara */
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 11px; background: var(--m-brand); color: #fff;
  font-weight: 700; font-size: 20px; line-height: 1;
}
.theme-modern .brand-text { min-width: 0; }
.theme-modern .brand-text img { display: block; height: 22px; width: auto; margin-top: 2px; }
.theme-modern .brand-sub { font-size: 11px; color: var(--m-muted); margin-top: 2px; letter-spacing: .3px; }
.theme-modern .brand .btn-close { margin-left: auto; }

/* elementy sidebara nie kurczą się na niskich ekranach – sidebar przewija się zamiast tego */
.theme-modern .sidebar { overflow-y: auto; scrollbar-width: thin; }
.theme-modern .sidebar > * { flex-shrink: 0; }

.theme-modern .sidebar-label {
  font-size: 11px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase;
  color: var(--m-muted); padding: 0 14px; margin: 22px 0 8px;
  white-space: nowrap; overflow: hidden;
}
.theme-modern .nav-item {
  display: flex; align-items: center; gap: 14px;
  min-height: 46px; padding: 0 14px; margin-bottom: 4px;
  border-radius: var(--m-radius);
  color: var(--m-text-2); font-size: 15px; font-weight: 400;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.theme-modern .nav-item i { font-size: 21px; flex-shrink: 0; }
.theme-modern .nav-item:hover { background: var(--m-hover); color: var(--m-text); }
.theme-modern .nav-item.active { background: var(--m-little-purple); color: var(--m-text); font-weight: 500; }
.theme-modern .nav-text { overflow: hidden; text-overflow: ellipsis; }
.theme-modern .nav-badge {
  margin-left: auto; min-width: 24px; padding: 1px 8px;
  border-radius: 999px; background: var(--m-th);
  font-size: 12px; font-weight: 500; color: var(--m-text-2); text-align: center;
}
.theme-modern .nav-item.active .nav-badge { background: var(--m-primary); color: #fff; }
.theme-modern .nav-item-danger { color: var(--m-red); }
.theme-modern .nav-item-danger:hover { background: #fff1f1; color: var(--m-red); }
.theme-modern .sidebar-bottom { margin-top: auto; padding-top: 16px; }

/* zwinięty sidebar (desktop) – tylko ikony */
@media (min-width: 992px) {
  .theme-modern .app.is-collapsed .sidebar.offcanvas-lg { width: 88px; padding: 0 16px 22px; }
  .theme-modern .app.is-collapsed .offcanvas-lg .brand-text,
  .theme-modern .app.is-collapsed .offcanvas-lg .nav-text,
  .theme-modern .app.is-collapsed .offcanvas-lg .nav-badge { display: none; }
  .theme-modern .app.is-collapsed .offcanvas-lg .sidebar-label { height: 1px; margin: 16px 8px; padding: 0; background: var(--m-divider); color: transparent; }
  .theme-modern .app.is-collapsed .offcanvas-lg .nav-item { justify-content: center; padding: 0; }
  .theme-modern .app.is-collapsed .offcanvas-lg .brand { justify-content: center; padding: 0; }
}
@media (min-width: 1200px) {
  .theme-modern .app.is-collapsed .sidebar.offcanvas-xl { width: 88px; padding: 0 16px 22px; }
  .theme-modern .app.is-collapsed .offcanvas-xl .brand-text,
  .theme-modern .app.is-collapsed .offcanvas-xl .nav-text,
  .theme-modern .app.is-collapsed .offcanvas-xl .nav-badge { display: none; }
  .theme-modern .app.is-collapsed .offcanvas-xl .sidebar-label { height: 1px; margin: 16px 8px; padding: 0; background: var(--m-divider); color: transparent; }
  .theme-modern .app.is-collapsed .offcanvas-xl .nav-item { justify-content: center; padding: 0; }
  .theme-modern .app.is-collapsed .offcanvas-xl .brand { justify-content: center; padding: 0; }
}

/* =========================== Topbar =========================== */
.theme-modern .topbar {
  height: 84px; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 0 32px;
  background: #fff; border-bottom: 1px solid var(--m-border);
}
.theme-modern .topbar-spacer { flex: 1; }
.theme-modern .btn-menu {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--m-border); background: #fff; color: var(--m-text);
  font-size: 22px;
}
.theme-modern .btn-menu:hover { background: var(--m-hover); border-color: var(--m-border); }
.theme-modern .icon-btn {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 0; background: transparent; color: var(--m-text);
  font-size: 24px; cursor: pointer;
}
.theme-modern .icon-btn:hover { background: var(--m-hover); }
.theme-modern .icon-btn .dot {
  position: absolute; top: 9px; right: 10px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--m-primary); box-shadow: 0 0 0 2px #fff;
}
.theme-modern .pill-select {
  height: 46px; display: inline-flex; align-items: center; gap: 10px;
  padding: 0 14px; border: 1px solid var(--m-border); border-radius: var(--m-radius);
  background: #fff; color: var(--m-text); font-size: 15px; cursor: pointer;
}
.theme-modern .pill-select i { font-size: 20px; }
.theme-modern .pill-select .ti-chevron-down { font-size: 16px; color: var(--m-text-2); }
.theme-modern .topbar-divider { width: 1px; height: 40px; background: var(--m-border); margin: 0 6px; }
.theme-modern .user-chip { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.theme-modern .user-chip .avatar { width: 46px; height: 46px; font-size: 15px; }
.theme-modern .user-name { font-size: 15px; font-weight: 500; line-height: 1.25; }
.theme-modern .user-role { font-size: 13px; color: var(--m-muted); line-height: 1.25; }

/* =========================== Nagłówek strony =========================== */
.theme-modern .page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.theme-modern .page-title { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -.2px; }
.theme-modern .page-sub { color: var(--m-muted); margin: 2px 0 0; font-size: 14px; }
.theme-modern .page-actions { margin-left: auto; display: flex; gap: 10px; }

.theme-modern .btn-m {
  height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 18px; border-radius: var(--m-radius);
  border: 1px solid var(--m-border); background: #fff; color: var(--m-text);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.theme-modern .btn-m i { font-size: 19px; }
.theme-modern .btn-m:hover { background: var(--m-hover); }
.theme-modern .btn-m.primary { background: var(--m-primary); border-color: var(--m-primary); color: #fff; }
.theme-modern .btn-m.primary:hover { background: var(--m-primary-hover); border-color: var(--m-primary-hover); }

/* =========================== Kafelki KPI =========================== */
.theme-modern .kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.theme-modern .kpi {
  background: #fff; border: 1px solid var(--m-border); border-radius: var(--m-radius-lg);
  padding: 22px 22px 20px;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; column-gap: 12px;
}
.theme-modern .kpi-icon {
  grid-column: 1 / -1;
  width: 46px; height: 46px; border-radius: var(--m-radius);
  display: grid; place-items: center; color:var(--m-primary); font-size: 24px;
  margin-bottom: 16px;
}
.theme-modern .kpi-icon.coral  { background: var(--m-tile-coral); }

.theme-modern .kpi-label { grid-column: 1 / -1; font-size: 15px; color: var(--m-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-modern .kpi-value { grid-column: 1; font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.theme-modern .kpi-value small { font-size: 16px; font-weight: 500; color: var(--m-muted); letter-spacing: 0; }
.theme-modern .kpi-spark { grid-column: 2; grid-row: 3; align-self: center; width: 110px; height: 44px; overflow: visible; }
.theme-modern .kpi-spark path { fill: none; stroke: url(#spark-grad); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* =========================== Panel (karta) =========================== */
.theme-modern .panel { background: #fff; border: 1px solid var(--m-border); border-radius: var(--m-radius-lg); padding: 22px 24px 18px; }
.theme-modern .panel-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.theme-modern .panel-title { font-size: 19px; font-weight: 500; margin: 0; }
.theme-modern .panel-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* przełącznik segmentowy zamiast zakładek */
.theme-modern .seg {
  display: inline-flex; gap: 2px; padding: 4px;
  background: var(--m-th); border-radius: var(--m-radius);
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.theme-modern .seg::-webkit-scrollbar { display: none; }
.theme-modern .seg-item {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  height: 34px; padding: 0 12px; border: 0; border-radius: var(--m-radius-sm);
  background: transparent; color: var(--m-text-2); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.theme-modern .seg-item:hover { color: var(--m-text); }
.theme-modern .seg-item.active { background: #fff; color: var(--m-text); box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.theme-modern .seg-count { font-size: 11px; font-weight: 600; color: var(--m-muted); }
.theme-modern .seg-item.active .seg-count { color: var(--m-primary); }

.theme-modern .search-box {
  display: flex; align-items: center; gap: 8px;
  width: 240px; height: 40px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--m-radius);
  background: var(--m-hover); color: var(--m-muted);
}
.theme-modern .search-box i { font-size: 18px; }
.theme-modern .search-box input { font-size: 14px; color: var(--m-text); }
.theme-modern .search-box input::placeholder { color: var(--m-muted); }
.theme-modern .search-box:focus-within { background: #fff; border-color: var(--m-primary); box-shadow: var(--m-focus); }
.theme-modern .kebab { width: 40px; height: 40px; font-size: 22px; }

/* =========================== Tabela =========================== */
.theme-modern .table-wrap { padding: 0; overflow-x: auto; }
.theme-modern .sort-icon { display: none; }

@media (min-width: 768px) {
  .theme-modern .ticket-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
  .theme-modern .ticket-table th {
    background: var(--m-th); color: var(--m-text-2);
    font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap;
    padding: 14px 16px;
  }
  .theme-modern .ticket-table th:first-child { border-radius: var(--m-radius) 0 0 var(--m-radius); }
  .theme-modern .ticket-table th:last-child  { border-radius: 0 var(--m-radius) var(--m-radius) 0; }
  .theme-modern .ticket-table td {
    padding: 16px; vertical-align: middle; color: var(--m-text);
    border-bottom: 1px solid var(--m-divider);
  }
  .theme-modern .ticket-table tbody tr:last-child td { border-bottom: 0; }
  .theme-modern .ticket-table tbody tr { cursor: pointer; }
  .theme-modern .ticket-table tbody tr:hover td { background: #fafbfc; }
  .theme-modern .ticket-table tbody tr.row-green td { color: var(--m-muted); }
  .theme-modern .ticket-table td.c-title { font-weight: 500; }
  .theme-modern .ticket-table tbody tr.row-green td.c-title { font-weight: 400; }
  .theme-modern .ticket-table td.c-field { font-variant-numeric: tabular-nums; }
  .theme-modern .ticket-table td.c-action { white-space: nowrap; text-align: right; }
  .theme-modern .ticket-table th:last-child { text-align: right; }
}

.theme-modern .row-num, .theme-modern .ticket-table td.row-num { color: var(--m-primary); font-weight: 500; font-variant-numeric: tabular-nums; }
.theme-modern .row-green .row-num, .theme-modern .ticket-table .row-green td.row-num { color: var(--m-muted); }
.theme-modern .mantis-link { color: var(--m-primary); font-weight: 500; text-decoration: none; }
.theme-modern .mantis-link:hover { text-decoration: underline; }
.theme-modern .dash { color: var(--m-gray-dot); }

/* status: kropka + tekst */
.theme-modern .status-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; color: var(--m-text); }
.theme-modern .status-badge i { display: none; }
.theme-modern .status-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--m-gray-dot); flex-shrink: 0; }
.theme-modern .status-wait::before     { background: var(--m-amber); }
.theme-modern .status-new::before      { background: var(--m-tile-blue); }
.theme-modern .status-taken::before    { background: var(--m-green); }
.theme-modern .status-progress::before { background: var(--m-purple); }
.theme-modern .status-closed           { color: var(--m-muted); }

/* awatary z inicjałami – pastelowe tła */
.theme-modern .avatar-chip { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.theme-modern .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 600;
  background: var(--m-primary-soft); color: white;
}
.theme-modern .av-1 { background: #ffe8e8; color: #d6484b; }
.theme-modern .av-2 { background: #dff7f5; color: #0f8d88; }
.theme-modern .av-3 { background: #e9edff; color: #3a51d6; }
.theme-modern .av-4 { background: #fff0e6; color: #cf672e; }
.theme-modern .av-5 { background: #f0eaff; color: #6a43cf; }
.theme-modern .av-photo { background: var(--m-brand); }

/* przyciski w wierszu */
.theme-modern .action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 38px; height: 38px; padding: 0 8px; margin: 0;
  border: 0; border-radius: var(--m-radius); background: transparent;
  color: var(--m-text-2); font-size: 14px; font-weight: 500; cursor: pointer;
}
.theme-modern .action-btn i { font-size: 20px !important; }
.theme-modern .action-btn:hover { background: var(--m-hover); color: var(--m-text); }
.theme-modern .action-btn.primary { color: var(--m-primary); }
.theme-modern .action-btn.primary:hover { background: var(--m-primary-soft); }
.theme-modern .action-btn.show-label { padding: 0 12px; }
.theme-modern .action-btn.show-label .act-label { display: inline; }

/* =========================== Paginacja =========================== */
.theme-modern .pagbar {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 0 0; margin-top: 4px; border-top: 1px solid var(--m-divider);
  background: transparent;
}
.theme-modern .per-page, .theme-modern .pag-info { font-size: 13px; color: var(--m-muted); display: flex; align-items: center; gap: 6px; }
.theme-modern .per-page select {
  height: 34px; padding: 0 8px; border: 1px solid var(--m-border); border-radius: var(--m-radius-sm);
  background: #fff; color: var(--m-text); font-size: 13px;
}
.theme-modern .pag-btn {
  min-width: 36px; height: 36px; padding: 0 8px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--m-border); border-radius: var(--m-radius);
  background: #fff; color: var(--m-text); font-size: 13px; font-weight: 500; cursor: pointer;
}
.theme-modern .pag-btn i { font-size: 16px !important; }
.theme-modern .pag-btn:hover:not(.active) { background: var(--m-hover); }
.theme-modern .pag-btn.active { background: var(--m-primary); border-color: var(--m-primary); color: #fff; }
.theme-modern .pag-btn.arrow { color: var(--m-text-2); }
.theme-modern .pag-dots { color: var(--m-muted); padding: 0 2px; }

/* =========================== Responsywność =========================== */
@media (max-width: 1399.98px) {
  .theme-modern .kpi-spark { width: 84px; }
}
@media (max-width: 1199.98px) {
  .theme-modern .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-modern .kpi-spark { width: 110px; }
}
@media (max-width: 991.98px) {
  .theme-modern .content { padding: 24px; }
  .theme-modern .topbar { padding: 0 24px; }
}

@media (max-width: 767.98px) {
  .theme-modern .topbar { height: 64px; padding: 0 12px; gap: 6px; flex-wrap: nowrap; }
  .theme-modern .btn-menu { width: 42px; height: 42px; }
  .theme-modern .user-chip .user-meta,
  .theme-modern .topbar-divider,
  .theme-modern .pill-select .pill-text { display: none; }
  .theme-modern .pill-select { height: 42px; padding: 0 10px; gap: 4px; }
  .theme-modern .user-chip .avatar { width: 40px; height: 40px; font-size: 14px; }
  .theme-modern .icon-btn { width: 40px; height: 40px; font-size: 22px; }

  .theme-modern .content { padding: 16px 12px 24px; }
  .theme-modern .page-head { align-items: center; margin-bottom: 16px; }
  .theme-modern .page-title { font-size: 20px; }
  .theme-modern .page-actions { width: 100%; margin-left: 0; }
  .theme-modern .page-actions .btn-m { flex: 1; }

  .theme-modern .kpi-grid { gap: 10px; margin-bottom: 16px; }
  .theme-modern .kpi { padding: 14px; border-radius: 14px; }
  .theme-modern .kpi-icon { width: 38px; height: 38px; font-size: 20px; margin-bottom: 10px; }
  .theme-modern .kpi-label { font-size: 13px; }
  .theme-modern .kpi-value { font-size: 22px; }
  .theme-modern .kpi-spark { display: none; }

  /* panel tabeli rozpada się – karty zgłoszeń stoją samodzielnie */
  .theme-modern .panel.table-panel { background: transparent; border: 0; padding: 0; }
  .theme-modern .panel-head { gap: 10px; margin-bottom: 12px; }
  .theme-modern .panel-title { font-size: 17px; }
  .theme-modern .panel-head .seg { order: 3; flex: 1 1 100%; }
  .theme-modern .panel-head .search-box { order: 4; flex: 1 1 100%; width: auto; height: 44px; background: #fff; border-color: var(--m-border); }

  .theme-modern .ticket-table tbody tr {
    border: 1px solid var(--m-border); border-left: 1px solid var(--m-border);
    border-radius: var(--m-radius-lg); padding: 16px; margin-bottom: 10px; box-shadow: none;
  }
  .theme-modern .ticket-table tbody tr.row-green { opacity: .8; }
  .theme-modern .ticket-table td.c-num { font-size: 13px; }
  .theme-modern .ticket-table td.c-status .status-badge { font-size: 13px; padding: 0; }
  .theme-modern .ticket-table td.c-field { font-size: 13px; }
  .theme-modern .ticket-table td.c-field::before { font-weight: 500; letter-spacing: .5px; color: var(--m-muted); }
  .theme-modern .ticket-table td.c-field .avatar { width: 24px; height: 24px; font-size: 10px; }
  .theme-modern .ticket-table td.c-field .avatar-chip { gap: 6px; }
  .theme-modern .ticket-table td.c-action .action-btn {
    height: 42px; border: 1px solid var(--m-border); background: #fff; border-radius: var(--m-radius);
  }
  .theme-modern .ticket-table td.c-action .action-btn.primary { background: var(--m-primary-soft); border-color: transparent; }

  .theme-modern .pagbar { border-top: 0; padding: 8px 0 env(safe-area-inset-bottom); }
  .theme-modern .pag-btn { min-width: 42px; height: 42px; }
}

/* ---------- Tabela na desktopie: Poppins jest szeroki, więc kolumny opcjonalne chowamy wcześniej ---------- */
@media (min-width: 768px) {
  .theme-modern .ticket-table th { padding: 13px 12px; font-size: 13px; }
  .theme-modern .ticket-table td { padding: 14px 12px; font-size: 13.5px; }
  .theme-modern .ticket-table td.c-title { min-width: 190px; }
  .theme-modern .ticket-table td.c-field,
  .theme-modern .ticket-table td.c-meta { white-space: nowrap; }
}
@media (min-width: 768px) and (max-width: 1599.98px) {
  .theme-modern .ticket-table .col-opt { display: none; }
}
@media (min-width: 768px) and (max-width: 1799.98px) {
  .theme-modern .ticket-table--wide .col-opt { display: none; }
}

/* znak „t” tylko w zwiniętym sidebarze */
@media (min-width: 992px) {
  .theme-modern .app.is-collapsed .offcanvas-lg .brand-mark { display: grid; }
}
@media (min-width: 1200px) {
  .theme-modern .app.is-collapsed .offcanvas-xl .brand-mark { display: grid; }
}

/* ---------- Telefon: przyciski strony i nagłówek panelu ---------- */
@media (max-width: 767.98px) {
  /* akcje drugorzędne jako same ikony, główna akcja zajmuje resztę */
  .theme-modern .page-actions .btn-m:not(.primary) { flex: 0 0 44px; padding: 0; }
  .theme-modern .page-actions .btn-m:not(.primary) .btn-text { display: none; }
  .theme-modern .page-actions .btn-m.primary { flex: 1 1 auto; }

  /* kolejność: tytuł + menu ⋮ → zakładki → wyszukiwarka */
  .theme-modern .panel-tools { display: contents; }
  .theme-modern .panel-head .kebab { order: 2; margin-left: auto; }
}

/* =====================================================================
   Logowanie (logowanie_operator.html, docelowo też logowanie_user.html)
   Układ dzielony: formularz po lewej, panel marki po prawej (≥992px).
   ===================================================================== */
.theme-modern.login-body { background: #fff; min-height: 100dvh; }
.theme-modern .login {
  min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

/* --- formularz --- */
.theme-modern .login-form-side {
  display: flex; flex-direction: column;
  padding: 36px 56px 28px;
}
.theme-modern .login-logo { display: block; align-self: flex-start; height: 28px; width: auto; }
.theme-modern .login-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.theme-modern .login-form { width: 100%; max-width: 400px; }

.theme-modern .login-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--m-primary-soft); color: var(--m-primary);
  font-size: 12px; font-weight: 500; margin-bottom: 18px;
}
.theme-modern .login-chip i { font-size: 16px; }
.theme-modern .login-title { font-size: 30px; font-weight: 600; letter-spacing: -.4px; margin: 0 0 6px; }
.theme-modern .login-sub { color: var(--m-muted); font-size: 15px; margin: 0 0 32px; }

.theme-modern .field { margin-bottom: 18px; }
.theme-modern .field-label { display: block; font-size: 14px; font-weight: 500; color: var(--m-text); margin-bottom: 8px; }
.theme-modern .field-control { position: relative; }
.theme-modern .field-control > .ti {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--m-muted); pointer-events: none;
}
.theme-modern .field-input {
  width: 100%; height: 50px; padding: 0 48px 0 46px;
  border: 1px solid var(--m-border); border-radius: var(--m-radius);
  background: #fff; color: var(--m-text); font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.theme-modern .field-input::placeholder { color: #b3b8c1; }
.theme-modern .field-input:hover { border-color: #d5d9e0; }
.theme-modern .field-input:focus { outline: 0; border-color: var(--m-primary); box-shadow: var(--m-focus); }
.theme-modern .field-control:focus-within > .ti { color: var(--m-primary); }
.theme-modern .field-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: 0; border-radius: var(--m-radius-sm);
  background: transparent; color: var(--m-muted); font-size: 20px;
  display: grid; place-items: center; cursor: pointer;
}
.theme-modern .field-toggle:hover { background: var(--m-hover); color: var(--m-text); }

.theme-modern .login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 24px; }
.theme-modern .check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--m-text-2); cursor: pointer; }
.theme-modern .check input {
  appearance: none; width: 20px; height: 20px; margin: 0;
  border: 1px solid #cfd4db; border-radius: 6px; background: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.theme-modern .check input:checked { background: var(--m-primary); border-color: var(--m-primary); }
.theme-modern .check input:checked::after {
  content: ""; width: 10px; height: 6px; margin-top: -2px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
}
.theme-modern .link { color: var(--m-primary); font-size: 14px; font-weight: 500; text-decoration: none; }
.theme-modern .link:hover { text-decoration: underline; }

.theme-modern .btn-m.block { width: 100%; height: 52px; font-size: 15px; }

.theme-modern .login-divider {
  display: flex; align-items: center; gap: 14px; margin: 28px 0 18px;
  color: var(--m-muted); font-size: 13px;
}
.theme-modern .login-divider::before,
.theme-modern .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--m-divider); }
.theme-modern .help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-modern .help-grid .btn-m { height: 46px; font-weight: 400; color: var(--m-text-2); }

.theme-modern .login-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--m-muted);
}
.theme-modern .login-foot a { color: var(--m-muted); text-decoration: none; }
.theme-modern .login-foot a:hover { color: var(--m-text); }

/* --- panel marki --- */
.theme-modern .login-brand-side {
  position: relative; overflow: hidden;
  margin: 16px 16px 16px 0; border-radius: 24px;
  /* background:
    radial-gradient(circle at 85% 10%, rgba(255,255,255,.16) 0, rgba(255,255,255,0) 38%),
    radial-gradient(circle at 10% 95%, rgba(28,192,192,.35) 0, rgba(28,192,192,0) 42%),
    linear-gradient(145deg, #1f4ef5 0%, #3b3fd8 55%, #5242d7 100%); */
  background: url("../images/bg_support_start.jpeg") no-repeat;
  background-size: cover;  
  color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 64px;
}
.theme-modern .login-brand-side::after {           /* delikatna siatka punktów */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,0) 70%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,0) 70%);
}
.theme-modern .brand-copy { position: relative; z-index: 1; max-width: 760px; }
.theme-modern .brand-copy h2 { font-size: clamp(2rem, 1.824rem + 0.588vw, 3rem); font-weight: 600; line-height: 1.2; letter-spacing: -.5px; margin: 0 0 14px; font-family: var(--m-font); }
.theme-modern .brand-copy p { font-size: 20px; color: rgba(255,255,255,.78); margin: 0; line-height: 1.6; }

/* podgląd aplikacji z elementów interfejsu */
.theme-modern .preview { position: relative; z-index: 1; margin-top: 44px; height: 300px; max-width: 520px; }
.theme-modern .preview-card {
  position: absolute; background: #fff; color: var(--m-text);
  border-radius: var(--m-radius-lg); padding: 18px 20px;
  box-shadow: 0 24px 48px rgba(15, 20, 80, .28);
}
.theme-modern .preview-card.kpi-mini { top: 0; left: 0; width: 250px; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; }
.theme-modern .preview-card.kpi-mini .kpi-icon { grid-column: 1; grid-row: 1 / 3; margin: 0; }
.theme-modern .preview-card.kpi-mini .kpi-label { grid-column: 2; grid-row: 1; font-size: 13px; }
.theme-modern .preview-card.kpi-mini .kpi-value { grid-column: 2; grid-row: 2; font-size: 24px; }
.theme-modern .preview-card.kpi-mini .kpi-spark { grid-column: 1 / -1; grid-row: 3; width: 100%; height: 40px; margin-top: 8px; }
.theme-modern .preview-card.ticket-mini { top: 70px; left: 210px; width: 300px; }
.theme-modern .ticket-mini .tm-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.theme-modern .ticket-mini .tm-num { color: var(--m-primary); font-weight: 500; }
.theme-modern .ticket-mini .tm-title { font-size: 15px; font-weight: 600; margin: 8px 0 2px; }
.theme-modern .ticket-mini .tm-meta { font-size: 12px; color: var(--m-muted); }
.theme-modern .ticket-mini .tm-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--m-border); font-size: 13px; }
.theme-modern .ticket-mini .tm-foot .avatar { width: 28px; height: 28px; font-size: 11px; }
.theme-modern .ticket-mini .tm-foot .tm-date { margin-left: auto; color: var(--m-muted); font-size: 12px; }
.theme-modern .preview-card.stat-mini { top: 210px; left: 40px; display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.theme-modern .stat-mini .kpi-icon { width: 38px; height: 38px; font-size: 20px; margin: 0; }
.theme-modern .stat-mini b { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; }
.theme-modern .stat-mini span { font-size: 12px; color: var(--m-muted); }

@media (max-width: 1199.98px) {
  .theme-modern .login-form-side { padding: 32px 40px 24px; }
  .theme-modern .login-brand-side { padding: 48px; }
  .theme-modern .preview { transform: scale(.85); transform-origin: left top; }
}
@media (max-width: 991.98px) {
  .theme-modern .login { grid-template-columns: 1fr; }
  .theme-modern .login-brand-side { display: none; }
}
@media (max-width: 575.98px) {
  .theme-modern .login-form-side { padding: 24px 20px calc(20px + env(safe-area-inset-bottom)); }
  .theme-modern .login-form-wrap { align-items: flex-start; padding: 36px 0 28px; }
  .theme-modern .login-title { font-size: 26px; }
  .theme-modern .login-sub { margin-bottom: 26px; }
  .theme-modern .field-input { font-size: 16px; }   /* bez auto-zoomu w iOS */
  .theme-modern .help-grid { grid-template-columns: 1fr; }
  .theme-modern .login-foot { justify-content: center; text-align: center; }
}

/* węższe odstępy w tabeli poniżej 1400px (panel operatora z rozwiniętym sidebarem) */
@media (min-width: 768px) and (max-width: 1399.98px) {
  .theme-modern .ticket-table th, .theme-modern .ticket-table td { padding-left: 9px; padding-right: 9px; }
  .theme-modern .ticket-table td.c-title { min-width: 150px; }
  .theme-modern .ticket-table .avatar-chip { gap: 7px; }
  .theme-modern .ticket-table .avatar-chip .avatar { width: 30px; height: 30px; font-size: 11px; }
}
