/* ============================================================
   DT Studio Helpdesk — style.css v2.0
   Inspiracja: identyfikacja wizualna DT Studio s.c.
   Geometryczna, techniczna, czerwono-czarna, profesjonalna
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&family=Barlow+Condensed:wght@600;700;800&display=swap');

:root {
  --red:        #c0392b;
  --red-dark:   #962d22;
  --red-light:  #e74c3c;
  --red-dim:    rgba(192,57,43,.12);
  --dark:       #0f0f0f;
  --dark-2:     #181818;
  --dark-3:     #222;
  --dark-4:     #2a2a2a;
  --gray-700:   #404040;
  --gray-600:   #5a5a5a;
  --gray-500:   #7a7a7a;
  --gray-400:   #9a9a9a;
  --gray-300:   #c0c0c0;
  --gray-200:   #e0e0e0;
  --gray-100:   #f2f2f2;
  --gray-50:    #f8f8f8;
  --white:      #ffffff;
  --sidebar-w:  252px;
  --header-h:   58px;
  --radius:     4px;
  --radius-lg:  6px;
  --shadow:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 20px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.18);
  --font:       'Barlow', 'Segoe UI', sans-serif;
  --font-cond:  'Barlow Condensed', 'Barlow', sans-serif;
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--dark-3);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── LAYOUT ────────────────────────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 300; overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
  border-right: 1px solid var(--dark-4);
}

/* dekoracyjna linia czerwona po lewej */
.sidebar::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--red) 0%, transparent 100%);
  z-index: 1;
}

.sidebar-logo {
  padding: 20px 20px 16px 22px;
  border-bottom: 1px solid var(--dark-4);
  display: flex; align-items: center; gap: 12px;
  position: relative;
}
/* geometryczny akcent w logo */
.sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: -1px; right: 0;
  width: 40px; height: 2px;
  background: var(--red);
}
.sidebar-logo img {
  height: 45px; width: auto;
/*  filter: brightness(0) invert(1); */
}

.sidebar-nav { flex: 1; padding: 10px 0; }

.sidebar-section {
  padding: 16px 20px 5px 22px;
  font-family: var(--font-cond);
  font-size: .7rem; font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  /* czerwona kreska przed sekcją */
  display: flex; align-items: center; gap: 8px;
}
.sidebar-section::before {
  content: '';
  display: inline-block;
  width: 14px; height: 2px;
  background: var(--red);
  flex-shrink: 0;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 20px 9px 22px;
  color: var(--gray-500);
  font-size: .875rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,.04);
}
.nav-item.active {
  color: var(--white);
  background: rgba(192,57,43,.18);
  border-left-color: var(--red);
  font-weight: 600;
}
.nav-item.active svg { color: var(--red); }
.nav-item .badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-family: var(--font-cond);
  font-size: .72rem; font-weight: 700;
  padding: 2px 7px; border-radius: 2px;
  min-width: 22px; text-align: center;
}

.sidebar-footer {
  padding: 14px 16px 16px 20px;
  border-top: 1px solid var(--dark-4);
  background: var(--dark-2);
}
.user-card { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-cond);
  font-size: .8rem; font-weight: 800;
  color: #fff; flex-shrink: 0;
  letter-spacing: .02em;
}
.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: .85rem; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role-label { font-size: .7rem; color: var(--gray-500); }
.user-actions { margin-left: auto; display: flex; gap: 4px; }
.btn-icon {
  background: none; border: none; color: var(--gray-500);
  cursor: pointer; padding: 5px; border-radius: var(--radius);
  display: flex; align-items: center; transition: color var(--transition);
}
.btn-icon:hover { color: var(--white); }
.btn-icon svg { width: 15px; height: 15px; }

/* ── MAIN AREA ──────────────────────────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}

/* ── TOPBAR ─────────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 2px solid var(--gray-200);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 0 var(--gray-200), var(--shadow);
  overflow: visible;
}
/* czerwona linia na dole topbara */
.topbar::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 120px; height: 2px;
  background: var(--red);
}
.topbar h1 {
  font-family: var(--font-cond);
  font-size: 1.25rem; font-weight: 700;
  color: var(--dark);
  letter-spacing: .01em;
  text-transform: uppercase;
  white-space: nowrap;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ── GLOBALNA WYSZUKIWARKA ───────────────────────────────────────────────────── */
.global-search { flex: 1; max-width: 340px; margin: 0 16px; }
.global-search-wrap {
  position: relative;
  display: flex; align-items: center;
}
.global-search-icon {
  position: absolute; left: 10px;
  color: var(--gray-400); pointer-events: none; display: flex;
}
.global-search-icon svg { width: 14px; height: 14px; }
.global-search-input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .82rem;
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--dark);
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}
.global-search-input:focus {
  border-color: var(--red);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--red-dim);
}
.global-search-input::placeholder { color: var(--gray-400); }
.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; color: var(--gray-600); padding: 4px;
}
.hamburger svg { width: 22px; height: 22px; }

/* ── CONTENT ────────────────────────────────────────────────────────────────── */
.content { padding: 24px 28px; flex: 1; max-width: 1440px; width: 100%; }

/* ── CARDS ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 10px;
  background: var(--white);
  position: relative;
}
/* czerwona linia na lewej krawędzi nagłówka karty */
.card-header::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
}
.card-header svg { width: 17px; height: 17px; color: var(--red); flex-shrink: 0; }
.card-header h2 {
  font-family: var(--font-cond);
  font-size: 1rem; font-weight: 700;
  color: var(--dark); flex: 1;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.card-header h3 {
  font-size: .9rem; font-weight: 600;
  color: var(--dark-3); flex: 1;
}
.card-body { padding: 20px; }

/* ── STATS GRID ─────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--red);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -10px; bottom: -10px;
  width: 60px; height: 60px;
  border: 2px solid var(--gray-200);
  border-radius: 50%;
  opacity: .5;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card.gray   { border-top-color: var(--gray-400); }
.stat-card.orange { border-top-color: #e67e22; }
.stat-card.green  { border-top-color: #27ae60; }
.stat-icon {
  width: 42px; height: 42px; border-radius: var(--radius);
  background: var(--red-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; color: var(--red); }
.stat-card.gray   .stat-icon { background: rgba(100,100,100,.1); }
.stat-card.gray   .stat-icon svg { color: var(--gray-500); }
.stat-card.orange .stat-icon { background: rgba(230,126,34,.1); }
.stat-card.orange .stat-icon svg { color: #e67e22; }
.stat-card.green  .stat-icon { background: rgba(39,174,96,.1); }
.stat-card.green  .stat-icon svg { color: #27ae60; }
.stat-val {
  font-family: var(--font-cond);
  font-size: 2rem; font-weight: 800;
  color: var(--dark); line-height: 1;
}
.stat-lbl { font-size: .73rem; color: var(--gray-500); margin-top: 3px; font-weight: 600; letter-spacing: .02em; }

/* ── TABLE ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-family: var(--font-cond);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 10px 14px; text-align: left; white-space: nowrap;
  border-bottom: 2px solid var(--gray-200);
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-200);
  font-size: .875rem; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(192,57,43,.03); }
.td-num {
  font-family: var(--font-cond);
  font-weight: 700; color: var(--red);
  font-size: .82rem; white-space: nowrap;
}
.td-title { font-weight: 600; color: var(--dark); max-width: 340px; }
.td-title small { display: block; color: var(--gray-500); font-weight: 400; font-size: .78rem; margin-top: 2px; }

/* ── BADGES ─────────────────────────────────────────────────────────────────── */
.badge-pill {
  display: inline-block; padding: 2px 9px;
  border-radius: 2px;
  font-family: var(--font-cond);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; white-space: nowrap;
  text-transform: uppercase;
}
.status-new       { background: #dbeafe; color: #1e40af; }
.status-open      { background: #fef3c7; color: #92400e; }
.status-progress  { background: rgba(192,57,43,.12); color: var(--red-dark); }
.status-waiting   { background: #f3e8ff; color: #6b21a8; }
.status-resolved  { background: #d1fae5; color: #065f46; }
.status-closed    { background: var(--gray-200); color: var(--gray-600); }
.prio-low         { background: var(--gray-200); color: var(--gray-600); }
.prio-normal      { background: #dbeafe; color: #1e40af; }
.prio-high        { background: #fef3c7; color: #92400e; }
.prio-critical    { background: #fee2e2; color: var(--red-dark); }

/* ── BUTTONS ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius); border: none;
  font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  line-height: 1; text-align: center;
  letter-spacing: .01em;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 2px 8px rgba(192,57,43,.25);
}
.btn-primary:hover {
  background: var(--red-dark); color: #fff;
  box-shadow: 0 4px 12px rgba(192,57,43,.35);
  transform: translateY(-1px);
}
.btn-secondary { background: var(--gray-200); color: var(--dark-3); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-ghost { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-100); border-color: var(--gray-300); }
.btn-sm  { padding: 5px 10px; font-size: .8rem; }
.btn-lg  { padding: 12px 24px; font-size: 1rem; font-weight: 700; }
.w-100   { width: 100%; justify-content: center; }

/* ── FORMS ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: .8rem; font-weight: 700;
  color: var(--panel-label-color, var(--gray-600)); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}
.form-group label span { color: var(--red); }
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .9rem; background: var(--white);
  color: var(--dark); transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,57,43,.10);
}
.form-control::placeholder { color: var(--gray-300); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 32px;
}
.form-row { display: grid; gap: 16px; }
.form-row.col-2 { grid-template-columns: 1fr 1fr; }
.form-row.col-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-hint { font-size: .77rem; color: var(--panel-hint-color, var(--gray-400)); margin-top: 4px; }

/* ── ALERTS ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: .88rem; margin-bottom: 18px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #ecfdf5; color: #065f46; border-left: 3px solid #059669; }
.alert-error   { background: #fef2f2; color: var(--red-dark); border-left: 3px solid var(--red); }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 3px solid #d97706; }
.alert-info    { background: #eff6ff; color: #1e40af; border-left: 3px solid #3b82f6; }

/* ── TICKET DETAIL ──────────────────────────────────────────────────────────── */
.ticket-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.ticket-main { display: flex; flex-direction: column; gap: 16px; }
.ticket-sidebar { display: flex; flex-direction: column; gap: 14px; }
.ticket-meta-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 10px 20px; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: .8rem; color: var(--gray-500);
}
.ticket-meta-row span { display: flex; align-items: center; gap: 5px; }
.ticket-meta-row svg { width: 13px; height: 13px; }
.ticket-description {
  padding: 20px; font-size: .9rem; line-height: 1.6;
  word-break: break-word;
  color: var(--dark-3);
}

/* ── COMMENTS ───────────────────────────────────────────────────────────────── */
.comments-list { display: flex; flex-direction: column; gap: 2px; }
.comment {
  display: flex; gap: 12px; padding: 14px 20px;
  border-top: 1px solid var(--gray-100);
}
.comment-system {
  background: var(--gray-50);
  font-size: .8rem; color: var(--gray-500);
  font-style: italic; padding: 8px 20px;
  border-top: 1px solid var(--gray-100);
  justify-content: center;
}
.comment-private { background: #fffdf0; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-cond);
  font-size: .75rem; font-weight: 800;
  color: #fff; flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.comment-header strong { font-size: .875rem; font-weight: 700; color: var(--dark); }
.comment-header time { font-size: .75rem; color: var(--gray-400); margin-left: auto; }
.comment-text {
  font-size: .875rem; line-height: 1.5;
  color: var(--dark-3);
  word-break: break-word;
}
.attachment-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  background: var(--gray-100); border: 1px solid var(--gray-200);
  font-size: .8rem; font-weight: 600; color: var(--dark-3);
  transition: all var(--transition);
}
.attachment-chip:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.attachment-chip svg { width: 14px; height: 14px; }

/* ── FILTER BAR ─────────────────────────────────────────────────────────────── */
.filters-bar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  margin-bottom: 16px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}

/* ── PAGINATION ─────────────────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  padding: 16px 20px; justify-content: center;
  border-top: 1px solid var(--gray-200);
}
.pagination a, .pagination span {
  padding: 6px 12px; border-radius: var(--radius);
  font-size: .85rem; font-weight: 600;
  border: 1px solid var(--gray-200);
  background: var(--white); color: var(--gray-600);
  transition: all var(--transition);
}
.pagination a:hover { background: var(--gray-100); border-color: var(--gray-300); color: var(--dark); }

/* ── GRID HELPERS ───────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* ── EMPTY STATE ────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 52px 24px; color: var(--gray-400); }
.empty-state svg { width: 52px; height: 52px; color: var(--gray-200); margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-cond); font-size: 1.1rem; font-weight: 700; color: var(--gray-500); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.empty-state p  { font-size: .875rem; }

/* ── MODAL / OVERLAY ────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200; display: none;
  align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  border-top: 3px solid var(--red);
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 {
  font-family: var(--font-cond);
  font-size: 1.05rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--gray-50);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE — inspiracja ulotką DT Studio: ciemne tło, geometria, czerwień
   ═══════════════════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--dark);
  overflow: hidden;
  position: relative;
}

/* tło z geometrycznymi dekoracjami jak w ulotce */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(192,57,43,.15) 0%, transparent 50%),
    linear-gradient(225deg, rgba(192,57,43,.08) 0%, transparent 50%);
  z-index: 0;
}

/* poziomy czerwony pasek na górze jak w materiałach firmowych */
.login-page::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-light) 50%, var(--red) 100%);
  z-index: 10;
}

/* lewa kolumna — branding */
.login-branding {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  padding: 60px 60px 60px 80px;
  position: relative; z-index: 1;
  border-right: 1px solid rgba(255,255,255,.06);
}

/* geometryczne kwadraty jak w ulotce */
.login-geo {
  position: absolute;
  right: 60px; bottom: 80px;
  display: flex; flex-direction: column; gap: 12px;
  opacity: .25;
}
.login-geo-sq {
  border: 2px solid var(--login-geo-color, var(--red));
  border-radius: 2px;
}
.login-geo-sq:nth-child(1) { width: 90px; height: 90px; }
.login-geo-sq:nth-child(2) { width: 60px; height: 60px; margin-left: 30px; }

.login-brand-logo img {
  height: 44px; width: auto;
  margin-bottom: 48px;
}

.login-brand-title {
  font-family: var(--font-cond);
  font-size: 3rem; font-weight: 800;
  color: var(--white);
  line-height: 1.0;
  letter-spacing: -.01em;
  margin-bottom: 8px;
}
.login-brand-title span { color: var(--red); }

.login-brand-sub {
  font-family: var(--font-cond);
  font-size: 1.1rem; font-weight: 600;
  color: var(--gray-500);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.login-brand-features {
  display: flex; flex-direction: column; gap: 14px;
  margin-top: 8px;
}
.login-feature {
  display: flex; align-items: center; gap: 12px;
  color: var(--gray-400); font-size: .9rem;
}
.login-feature::before {
  content: '';
  width: 20px; height: 2px;
  background: var(--red);
  flex-shrink: 0;
}

/* czerwony pasek pionowy — separator */
.login-separator {
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--red) 30%, var(--red) 70%, transparent);
  align-self: stretch;
  z-index: 1;
}

/* prawa kolumna — formularz */
.login-form-area {
  width: 440px;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  position: relative; z-index: 1;
  background: rgba(255,255,255,.02);
}

.login-form-header {
  margin-bottom: 36px;
}
.login-form-header h2 {
  font-family: var(--font-cond);
  font-size: 1.6rem; font-weight: 800;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.login-form-header p {
  font-size: .85rem; color: var(--gray-500);
}

/* pola logowania — ciemne na ciemnym tle */
.login-form-area .form-group label {
  color: var(--login-label-color, var(--gray-400));
}
.login-form-area .form-control {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: var(--white);
}
.login-form-area .form-control::placeholder { color: var(--login-placeholder-color, rgba(255,255,255,.25)); }
.login-form-area .form-control:focus {
  border-color: var(--red);
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 0 3px rgba(192,57,43,.2);
}
.login-form-area .btn-primary {
  background: var(--login-btn-bg, var(--red));
  font-family: var(--font-cond);
  font-size: 1rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 13px 24px;
  box-shadow: var(--login-btn-shadow, none);
}
.login-form-area .btn-primary:hover {
  background: var(--login-btn-hover, var(--red-light));
  box-shadow: var(--login-btn-shadow-hover, none);
}
.login-form-area .alert-error {
  background: rgba(192,57,43,.15);
  border-left-color: var(--red);
  color: #fca5a5;
}
.login-footer-note {
  margin-top: 24px;
  font-size: .78rem; color: var(--gray-600);
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 20px;
}
.login-copyright {
  position: absolute;
  bottom: 24px; left: 0; right: 0;
  text-align: center;
  font-size: .72rem; color: var(--gray-500);
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INSTALL PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.install-page {
  min-height: 100vh; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.install-box { max-width: 640px; width: 100%; }
.install-step {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
  border-top: 3px solid var(--red);
}
.install-header {
  background: var(--dark); padding: 22px 32px;
  display: flex; align-items: center; gap: 14px;
}
.install-header img { 
height: 45px; 
/*filter: brightness(0) invert(1); */
}
.install-header h1 {
  font-family: var(--font-cond);
  color: var(--white); font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.install-header p { color: var(--gray-500); font-size: .8rem; margin-top: 2px; }
.install-body { padding: 28px 32px; }
.install-steps-bar {
  display: flex; gap: 0; margin-bottom: 26px;
  border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden;
}
.step-item {
  flex: 1; text-align: center; padding: 9px 4px;
  font-family: var(--font-cond);
  font-size: .75rem; font-weight: 700;
  color: var(--gray-400); border-bottom: 3px solid transparent;
  background: var(--gray-50);
  transition: all var(--transition);
  letter-spacing: .05em; text-transform: uppercase;
  border-right: 1px solid var(--gray-200);
}
.step-item:last-child { border-right: none; }
.step-item.active { color: var(--red); border-bottom-color: var(--red); background: var(--white); }
.step-item.done   { color: #059669; border-bottom-color: #059669; background: #f0fdf4; }

/* ── MISC / UTILITIES ───────────────────────────────────────────────────────── */
.text-red   { color: var(--red); }
.text-muted { color: var(--gray-500); }
.text-small { font-size: .8rem; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; } .flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.hr { border: none; border-top: 1px solid var(--gray-200); margin: 18px 0; }
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ── TICKET DETAIL — CLIENT VIEW (brakujące klasy) ─────────────────────────── */
.ticket-body-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
.ticket-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--gray-200);
}
.ticket-num {
  font-family: var(--font-cond);
  font-size: .75rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--gray-400); margin-bottom: 6px;
}
.ticket-header h1 {
  font-size: 1.25rem; font-weight: 800;
  color: var(--dark); margin: 0 0 10px;
}
.ticket-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: .8rem; color: var(--gray-500);
}
.ticket-meta-item {
  display: flex; align-items: center; gap: 5px;
}
.ticket-meta-item svg { width: 13px; height: 13px; }

/* Sidebar informacji o zgłoszeniu */
.sidebar-info {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border-top: 2px solid var(--red);
}
.info-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.info-section:last-child { border-bottom: none; }
.info-label {
  font-family: var(--font-cond);
  font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--gray-400); margin-bottom: 5px;
}
.info-value {
  font-size: .875rem; font-weight: 600; color: var(--dark);
}

/* Komentarze — styl bąbelkowy */
.comments {
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 0;
}
.comment {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--gray-100);
}
.comment:first-child { border-top: none; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-cond);
  font-size: .72rem; font-weight: 800;
  color: #fff; flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-bubble {
  background: var(--gray-100);
  border-radius: 0 var(--radius-lg) var(--radius-lg);
  padding: 8px 12px;
  font-size: .875rem; line-height: 1.5;
  color: var(--dark-3);
  word-break: break-word;
  border: 1px solid var(--gray-200);
}
.comment-bubble.own {
  background: var(--red-dim);
  border-color: rgba(192,57,43,.2);
  border-radius: var(--radius-lg) 0 var(--radius-lg) var(--radius-lg);
}
.comment-bubble.system {
  background: var(--gray-50);
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius);
  color: var(--gray-500);
  font-size: .8rem; font-style: italic;
  text-align: center;
}
.comment-meta {
  font-size: .72rem; color: var(--gray-400);
  margin-top: 5px; text-align: right;
}
.mb-2 { margin-bottom: 16px; }
.hr { border: none; border-top: 1px solid var(--gray-200); margin: 16px 0; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ticket-body-grid { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0 !important; transition: margin-left var(--transition); }
  .sidebar.open ~ .main-area { margin-left: var(--sidebar-w) !important; }
  .hamburger { display: flex; }
  .ticket-layout { grid-template-columns: 1fr; }
  .form-row.col-2, .form-row.col-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .login-branding { display: none; }
  .login-separator { display: none; }
  .login-form-area { width: 100%; padding: 48px 32px; }
}

/* ── PRINT ──────────────────────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .filters-bar, .pagination { display: none !important; }
  .main-area { margin-left: 0; }
  .content { padding: 0; }
}

/* ── TOPBAR CONTACT ─────────────────────────────────────────────────────────── */
.topbar-contact {
  display: flex; align-items: center; gap: 8px;
  margin-right: 4px;
}
.contact-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: var(--radius);
  background: var(--gray-100); border: 1px solid var(--gray-200);
  color: var(--gray-600); font-size: .78rem; font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.contact-chip svg { width: 13px; height: 13px; }
.contact-chip:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ── NOTIFICATION BELL ──────────────────────────────────────────────────────── */
.notif-wrap {
  position: relative;
  display: flex; align-items: center;
}
.notif-btn {
  background: none; border: none; cursor: pointer;
  color: var(--gray-500); padding: 8px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: color .18s;
}
.notif-btn svg { width: 20px; height: 20px; }
.notif-btn:hover { color: var(--dark); }
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  background: var(--red); color: #fff;
  font-family: var(--font-cond); font-size: .62rem; font-weight: 800;
  padding: 1px 5px; border-radius: 8px; min-width: 17px;
  text-align: center; line-height: 1.4;
  pointer-events: none;
}

.notif-dropdown {
  position: fixed;
  top: 58px; /* var(--header-h) */
  right: 16px;
  width: 320px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  z-index: 9999;
  display: none;
  overflow: hidden;
  border-top: 2px solid var(--red);
}
.notif-dropdown.open { display: block; }

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
  font-family: var(--font-cond); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--dark);
  background: var(--gray-50);
}
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  transition: background .15s, opacity .2s;
  text-decoration: none; color: inherit;
  cursor: pointer;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: rgba(192,57,43,.03); }
.notif-item.unread:hover { background: rgba(192,57,43,.06); }
.notif-content { flex: 1; min-width: 0; }
.notif-title {
  font-size: .82rem; font-weight: 600; color: var(--dark); line-height: 1.4;
}
.notif-body {
  font-size: .75rem; color: var(--gray-500);
  margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-time { font-size: .7rem; color: var(--gray-400); margin-top: 3px; }
.notif-empty {
  padding: 28px 16px; text-align: center;
  font-size: .82rem; color: var(--gray-400); line-height: 1.8;
}

/* Ikony inline w wizytówkach, chipach kontaktowych, linkach ─────────────── */
.tech-card-link svg,
.contact-link svg  { width: 14px; height: 14px; flex-shrink: 0; }
.topbar-contact .contact-chip svg { width: 13px; height: 13px; }

/* ═══════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — kompletna naprawa dla wszystkich ekranów < 640px
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── 768px — tablety ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Broadcast — layout 2-kolumnowy → 1 kolumna */
  div[style*="grid-template-columns:1fr 340px"] {
    display: block !important;
  }
  div[style*="grid-template-columns:1fr 340px"] > * {
    margin-bottom: 16px;
  }

  /* Settings — SLA grid 4 kolumny → 2 */
  div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2,1fr) !important;
  }

  /* Settings — dodaj/edytuj poziom SLA: 3 kolumny → 1 */
  div[style*="grid-template-columns:1fr 100px 80px"] {
    grid-template-columns: 1fr !important;
  }

  /* Security — grid 2 kolumny */
  div[style*="grid-template-columns:1fr 1fr;gap:16px"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── 640px — mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {

  /* ── META ── */
  * { -webkit-tap-highlight-color: transparent; }

  /* ── TOPBAR ── */
  .topbar { padding: 0 10px; gap: 6px; overflow: visible; }
  .topbar h1 { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .global-search { display: none; }
  .topbar-contact { display: none; }
  .topbar-actions { gap: 4px; flex-shrink: 0; }

  /* ── CONTENT ── */
  .content { padding: 10px; }
  .card { margin-bottom: 12px; }
  .card-body { padding: 14px; }
  .card-header { padding: 10px 14px; }

  /* ── KAFELKI DASHBOARD ── */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
  .stat-card { padding: 12px; }
  .stat-val { font-size: 1.5rem; }
  .stat-lbl { font-size: .72rem; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-icon svg { width: 15px; height: 15px; }

  /* ── GRID LAYOUT ── */
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 12px; }

  /* ── FORMULARZ NOWEGO ZGŁOSZENIA ── */
  .form-row.col-2, .form-row.col-3 { grid-template-columns: 1fr; }
  .form-group { margin-bottom: 12px; }

  /* ── FILTRY ── */
  .filters-bar { flex-direction: column; gap: 8px; padding: 10px; }
  .filters-bar form { flex-wrap: wrap; gap: 8px; }
  .filters-bar select,
  .filters-bar input.form-control { width: 100% !important; min-width: 0 !important; }
  .filters-bar .btn { justify-content: center; }

  /* ── TABELE — przewijanie poziome ── */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  td, th { padding: 7px 8px !important; font-size: .78rem !important; white-space: nowrap; }
  .badge-pill { font-size: .68rem; padding: 2px 6px; }

  /* ── ZGŁOSZENIA — ukryj: Priorytet, Przypisany, Data ── */
  .tickets-table th:nth-child(5),
  .tickets-table td:nth-child(5),
  .tickets-table th:nth-child(6),
  .tickets-table td:nth-child(6),
  .tickets-table th:nth-child(7),
  .tickets-table td:nth-child(7) { display: none !important; }

  /* ── UŻYTKOWNICY — zostaw: Nazwa, Rola, Status, Akcje ── */
  .users-table th:nth-child(2),
  .users-table td:nth-child(2),
  .users-table th:nth-child(3),
  .users-table td:nth-child(3),
  .users-table th:nth-child(5),
  .users-table td:nth-child(5),
  .users-table th:nth-child(6),
  .users-table td:nth-child(6) { display: none !important; }

  /* ── WIZYTY — ukryj: Lokalizacja, Technik, Akcje ── */
  .visits-table th:nth-child(4),
  .visits-table td:nth-child(4),
  .visits-table th:nth-child(5),
  .visits-table td:nth-child(5),
  .visits-table th:nth-child(7),
  .visits-table td:nth-child(7) { display: none !important; }
  .visits-table select.form-control { font-size:.7rem !important; padding:3px 4px !important; }

  /* ── HISTORIA — ukryj: IP, Typ obiektu, Szczegóły ── */
  .activity-table th:nth-child(4),
  .activity-table td:nth-child(4),
  .activity-table th:nth-child(5),
  .activity-table td:nth-child(5),
  .activity-table th:nth-child(6),
  .activity-table td:nth-child(6) { display: none !important; }

  /* ── TICKET DETAIL — layout 1 kolumna ── */
  .ticket-layout { grid-template-columns: 1fr !important; }
  .ticket-body-grid { grid-template-columns: 1fr !important; }

  /* Przyciski akcji nad komentarzem */
  .comment-actions { flex-wrap: wrap; gap: 6px; }

  /* ── USTAWIENIA — tabs nawigacja ── */
  .tabs-nav { flex-wrap: wrap; gap: 4px; }
  .tab-item { font-size: .75rem; padding: 6px 10px; }

  /* ── USTAWIENIA — SLA grid → 2 kolumny ── */
  div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2,1fr) !important;
    gap: 10px !important;
  }

  /* ── USTAWIENIA — formularz dodaj poziom SLA ── */
  div[style*="grid-template-columns:1fr 100px 80px"] {
    grid-template-columns: 1fr !important;
  }

  /* ── BROADCAST — grid → 1 kolumna ── */
  div[style*="grid-template-columns:1fr 340px"] {
    display: block !important;
  }

  /* ── PAGINACJA ── */
  .pagination { flex-wrap: wrap; gap: 4px; justify-content: center; }

  /* ── PRZYCISKI W NAGŁÓWKACH ── */
  .card-header { flex-wrap: wrap; gap: 8px; }
  .card-header .btn { font-size: .75rem; padding: 5px 10px; }

  /* ── CLIENT — kafelki stat ── */
  div[style*="display:flex"][style*="min-width:160px"] > div {
    min-width: 0 !important;
    flex: 1 1 120px;
  }

  /* ── LOGOWANIE ── */
  .login-form-area { padding: 32px 18px; }

  /* ── POWIADOMIENIA — full width ── */
  .notif-dropdown { right: 8px; left: 8px; width: auto !important; top: 54px !important; }

  /* ── PRZYCISKI FORMULARZY — full width na mobile ── */
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* ── IMPERSONATION BANNER ── */
  div[style*="background:#1a3a5c"] {
    flex-wrap: wrap;
    font-size: .78rem;
  }
  div[style*="background:#1a3a5c"] form {
    margin-left: 0 !important;
    width: 100%;
    margin-top: 8px;
  }
  div[style*="background:#1a3a5c"] form button {
    width: 100%;
    justify-content: center;
  }
}

/* ── 400px — bardzo małe ekrany ─────────────────────────────────────────────── */
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar h1 { font-size: .78rem; }
  td, th { padding: 5px 6px !important; font-size: .73rem !important; }
  .stat-val { font-size: 1.3rem; }
}

/* ── WIZYTY MOBILE KARTY ────────────────────────────────────────────────────── */
.visits-desktop { display: block !important; }
.visits-mobile  { display: none !important; }

.visit-card {
  border-bottom: 1px solid var(--gray-100);
  padding: 12px 14px;
}
.visit-card:last-child { border-bottom: none; }
.visit-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.visit-card-name  { font-weight: 700; font-size: .88rem; color: var(--dark); }
.visit-card-title { font-size: .82rem; color: var(--gray-600); margin-top: 2px; }
.visit-card-meta  { font-size: .72rem; color: var(--gray-400); margin-top: 2px; }
.visit-card-date  { font-size: .8rem; font-weight: 600; color: var(--dark); text-align: right; white-space: nowrap; flex-shrink: 0; }
.visit-card-bottom {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── MOBILE FIXES v1.8.2 ────────────────────────────────────────────────────── */
@media (max-width: 640px) {

  /* Statystyki — grid 2-kolumnowy (wg klientów/techników) → 1 kolumna */
  .report-grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* Statystyki — oceny (200px + wykres) → 1 kolumna */
  .report-grid-rating {
    grid-template-columns: 1fr !important;
  }

  /* Statystyki — KPI grid 2 kolumny */
  .kpi-grid { grid-template-columns: 1fr 1fr !important; }

  /* Wykresy SVG nie wylewają się */
  svg { max-width: 100%; height: auto; }

  /* Wizyty — ukryj tabelę, pokaż karty */
  .visits-desktop { display: none !important; }
  .visits-mobile  { display: block !important; }

  /* Wizyty — pasek filtrów pionowo */
  .visits-filters {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .visits-filters form { flex-wrap: wrap; }
  .visits-filters select,
  .visits-filters input { width: 100% !important; }
}
