/* Reset podstawowy */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

body.user-portal {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    overflow: auto;
}

/* Strona logowania - bez scroll */
body.kp-login-page {
    height: 100vh;
    overflow: hidden;
}

/* Container główny */
.up-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ----------------------------------
   ALERTY - TOAST NOTIFICATIONS
---------------------------------- */
#kp-login-msg {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

#kp-login-msg .kp-alert {
    pointer-events: all;
    margin-bottom: 12px;
}

.kp-alert {
    border-radius: 12px;
    padding: 16px 20px;
    padding-left: 50px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    animation: slideInRight .4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(0,0,0,.15),
        0 0 0 1px rgba(0,0,0,.05);
    backdrop-filter: blur(10px);
}

.kp-alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: currentColor;
}

.kp-alert::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    color: currentColor;
}

.kp-alert-error {
    background: rgba(255, 234, 234, 0.98);
    color: #b3261e;
    border-color: #f5b5b5;
}

.kp-alert-error::after {
    content: "\f00d"; /* fa-times */
}

.kp-alert-ok {
    background: rgba(233, 249, 238, 0.98);
    color: #1a7f38;
    border-color: #b5e7c6;
}

.kp-alert-ok::after {
    content: "\f00c"; /* fa-check */
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {opacity:0; transform:translateY(-4px);}
    to   {opacity:1; transform:translateY(0);}
}

/* ----------------------------------
   BOX NA ŚRODKU
---------------------------------- */
.kp-login-wrap {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.kp-login-card {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    background: #fff;
    color: #111;
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow:
        0 20px 60px rgba(0,0,0,.1),
        0 0 0 1px rgba(0,0,0,.05);
    border: 1px solid rgba(255,255,255,.8);
    animation: scaleIn .5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    backdrop-filter: blur(10px);
    overflow-y: auto;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.kp-login-card h2 {
    margin: 0 0 20px;
    font-size: 24px;
    line-height: 1.2;
    text-align: center;
    font-weight: 700;
    color: #222;
}

/* ----------------------------------
   FORMULARZ
---------------------------------- */
.kp-login-form p {
    margin-bottom: 14px;
}

.kp-login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    transition: color .2s ease, transform .2s ease;
}

#kp-user, #kp-pass {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #e1e8ed;
    background: #f8f9fa;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 500;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
}

#kp-user::placeholder,
#kp-pass::placeholder {
    color: #99a3ad;
    opacity: 1;
    font-weight: 400;
}

#kp-user:hover, #kp-pass:hover {
    border-color: #d1d8dd;
    background: #fff;
}

#kp-user:focus, #kp-pass:focus {
    outline: none;
    border-color: #ED1C24;
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(237,28,36,.1),
        0 4px 12px rgba(237,28,36,.15);
    transform: translateY(-2px);
}

#kp-user:focus::placeholder,
#kp-pass:focus::placeholder {
    opacity: 0.5;
}

.kp-pass-wrap {
    position: relative;
}

.kp-pass-wrap input {
    padding-right: 45px !important;
}

#kp-toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #777;
    transition: all .2s ease;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#kp-toggle-pass:hover {
    color: #ED1C24;
    transform: translateY(-50%) scale(1.1);
}

#kp-toggle-pass:active {
    transform: translateY(-50%) scale(0.95);
}

/* ----------------------------------
   PRZYCISK
---------------------------------- */
#kp-submit {
    width: 100%;
    padding: 16px 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #ED1C24 0%, #ff3b45 100%);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    letter-spacing: .4px;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 8px 24px rgba(237,28,36,.3),
        0 2px 8px rgba(237,28,36,.2);
    position: relative;
    overflow: hidden;
}

#kp-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
    transition: left .5s ease;
}

#kp-submit:hover::before {
    left: 100%;
}

#kp-submit:hover {
    background: linear-gradient(135deg, #ff303a 0%, #ED1C24 100%);
    transform: translateY(-3px);
    box-shadow:
        0 12px 32px rgba(237,28,36,.4),
        0 4px 12px rgba(237,28,36,.25);
}

#kp-submit:active {
    transform: translateY(-1px);
    box-shadow:
        0 4px 16px rgba(237,28,36,.3),
        0 2px 6px rgba(237,28,36,.2);
}

#kp-submit:focus {
    outline: none;
    box-shadow:
        0 8px 24px rgba(237,28,36,.3),
        0 0 0 4px rgba(237,28,36,.2);
}

/* ----------------------------------
   OPIS I LINKI
---------------------------------- */
.kp-login-desc {
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: #6c757d;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 3px solid #ED1C24;
    margin-top: 4px;
}

.kp-login-links {
    margin-top: 16px;
    display:flex;
    justify-content:center;
    gap:12px;
    font-size: 13px;
    color:#555;
}

.kp-btn {
    display:inline-block;
    background:#ED1C24;
    color:#fff;
    padding:10px 16px;
    border-radius:10px;
    text-decoration:none;
    font-weight:600;
    transition: all .2s ease;
}
.kp-btn:hover {
    background:#d3151b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237,28,36,.25);
}

/* LOGIN – logo */
.kp-login-header {
    text-align: center;
    margin-bottom: 16px;
}

.kp-login-logo {
    max-width: 140px;
    width: 140px;
    height: auto;
    display: block;
    margin: 0 auto 10px auto;
    image-rendering: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.1));
}

.kp-login-header h1 {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    letter-spacing: -.5px;
}

.kp-login-header p {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

/* iOS/Android: zapobieganie zoomowaniu */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ----------------------------------
   RESPONSIVE DESIGN
---------------------------------- */

/* Tablet - Medium devices */
@media (max-width: 768px) {
    .kp-login-card {
        max-width: 90%;
        padding: 36px 28px;
    }

    .kp-login-logo {
        max-width: 160px;
        width: 160px;
    }

    .kp-login-header h1 {
        font-size: 24px;
    }
}

/* Mobile - Small devices */
@media (max-width: 480px) {
    .kp-login-wrap {
        padding: 20px;
    }

    .kp-login-card {
        max-width: 100%;
        padding: 28px 20px;
        border-radius: 16px;
    }

    /* Toast notifications na mobile */
    #kp-login-msg {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .kp-login-logo {
        max-width: 140px;
        width: 140px;
        margin-bottom: 12px;
    }

    .kp-login-header {
        margin-bottom: 20px;
    }

    .kp-login-header h1 {
        font-size: 22px;
    }

    .kp-login-header p {
        font-size: 14px;
    }

    .kp-login-form p {
        margin-bottom: 16px;
    }

    #kp-user, #kp-pass {
        padding: 12px 14px;
        font-size: 16px;
    }

    #kp-submit {
        padding: 14px 18px;
        font-size: 16px;
    }

    .kp-login-desc {
        font-size: 13px;
    }
}

/* Mobile - Extra small devices */
@media (max-width: 360px) {
    .kp-login-card {
        padding: 24px 20px;
    }

    .kp-login-logo {
        max-width: 120px;
        width: 120px;
    }

    .kp-login-header h1 {
        font-size: 20px;
    }
}

/* Touch devices - większe obszary klikalne */
@media (hover: none) and (pointer: coarse) {
    #kp-user, #kp-pass {
        min-height: 48px;
        font-size: 16px !important;
    }

    #kp-submit {
        min-height: 52px;
        font-size: 16px !important;
    }

    #kp-toggle-pass {
        padding: 8px;
    }

    .kp-login-form label {
        font-size: 15px !important;
    }
}

/* Landscape orientation na mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .kp-login-wrap {
        padding: 12px;
        align-items: center;
    }

    .kp-login-card {
        padding: 24px 28px;
    }

    .kp-login-logo {
        max-width: 100px;
        margin-bottom: 8px;
    }

    .kp-login-header {
        margin-bottom: 16px;
    }

    .kp-login-header h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .kp-login-header p {
        font-size: 13px;
    }

    .kp-login-form p {
        margin-bottom: 12px;
    }
}

/* Dark mode support - nadpisz na białe */
@media (prefers-color-scheme: dark) {
    body.user-portal,
    body.kp-login-page {
        background: #ffffff !important;
    }

    .kp-login-card {
        background: #ffffff;
        box-shadow:
            0 20px 60px rgba(0,0,0,.1),
            0 0 0 1px rgba(0,0,0,.05);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== DASHBOARD ===== */
.up-dashboard {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: fadeIn 0.4s ease-in-out;
}

.up-dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.up-dashboard-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

.up-btn-logout {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.up-btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.up-dashboard-content {
    padding: 40px;
}

.up-user-info {
    background: #f7f9fc;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
}

.up-user-info h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #333;
}

.up-user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.up-info-item {
    display: flex;
    flex-direction: column;
}

.up-info-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.up-info-value {
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

.up-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.up-stat-card {
    background: #f7f9fc;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.up-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.up-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.up-stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.up-recent-activity {
    margin-top: 30px;
}

.up-recent-activity h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #333;
}

.up-activity-list {
    list-style: none;
}

.up-activity-item {
    padding: 16px;
    border-bottom: 1px solid #e1e8ed;
    transition: background 0.2s ease;
}

.up-activity-item:last-child {
    border-bottom: none;
}

.up-activity-item:hover {
    background: #f7f9fc;
}

.up-activity-item strong {
    color: #333;
    font-weight: 600;
}

.up-activity-item small {
    color: #999;
    font-size: 13px;
}

/* Responsywność */
@media (max-width: 768px) {
    .up-container {
        padding: 10px;
    }

    .up-login-box {
        padding: 30px 20px;
    }

    .up-dashboard-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .up-dashboard-content {
        padding: 20px;
    }

    .up-user-info-grid,
    .up-stats {
        grid-template-columns: 1fr;
    }
}

/* ======================================
   DASHBOARD PANEL STYLES  
====================================== */

/* ——— TOPBAR ——— */
.kp-topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  background:#fff;
  border:1px solid #eee;
  border-radius:12px;
  padding:12px 16px;
  box-shadow:0 6px 20px rgba(0,0,0,.05);
  margin-bottom:14px;
}
.kp-brand {
  display:flex;
  align-items:center;
  gap:10px;
}
.kp-logo {
  width:36px;
  height:36px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#ED1C24,#ff3b45);
  color:#fff;
  font-weight:800;
  letter-spacing:.5px;
}
.kp-appname {
  font-weight:700;
  color:#222;
}

/* ——— USER CARD ——— */
.kp-usercard {
  display:flex;
  align-items:center;
  gap:12px;
}
.kp-usercard-left {
  position:relative;
  flex-shrink:0;
}
.kp-usercard-avatar {
  width:94px;
  height:94px;
  border-radius:50%;
  object-fit:cover;
  border:3px solid transparent;
  background:linear-gradient(135deg,#ED1C24,#ff4d59) border-box;
  box-shadow:0 4px 14px rgba(0,0,0,.15);
  transition:box-shadow .25s ease, transform .25s ease;
}

.kp-usercard-right {
  display:flex;
  flex-direction:column;
  gap:4px;
}
.kp-usercard-name {
  font-size:16px;
  font-weight:800;
  color:#111;
  line-height:1.1;
}
.kp-usercard-meta {
  display:flex;
  gap:8px;
  align-items:center;
}

/* Badge (rola / status) */
.kp-badge {
  display:inline-block;
  padding:3px 8px;
  font-size:12px;
  font-weight:700;
  border-radius:999px;
  background:#f2f3f5;
  border:1px solid #e5e7eb;
  color:#333;
}

/* FAB przy avatarze */
#up-avatar-change {
  position:absolute;
  right:0;
  bottom:0;
  width:32px;
  height:32px;
  border-radius:50%;
  border:none;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  cursor:pointer;
  background:#ED1C24;
  color:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.2);
  transition:background .2s ease, transform .15s ease;
}
#up-avatar-change:hover {
  background:#ff3b45;
  transform:scale(1.05);
}
#up-avatar-change:active {
  transform:scale(0.95);
}
#up-avatar-change svg {
  fill:currentColor;
}

/* Akcje dodatkowe */
.kp-usercard-actions {
  display:flex;
  gap:8px;
  margin-top:4px;
}
.kp-btn-ghost {
  padding:6px 10px;
  font-size:12px;
  font-weight:600;
  border-radius:8px;
  border:1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
  transition:background .2s ease, border-color .2s ease, color .2s ease, transform .06s ease;
}
.kp-btn-ghost:hover {
  background:#ED1C24;
  color:#fff;
  border-color:#ED1C24;
  transform:translateY(-1px);
}

/* ——— SHELL (sidebar + content) ——— */
.kp-shell {
  display:flex;
  min-height:60vh;
  background:#fff;
  border-radius:12px;
  box-shadow:0 8px 30px rgba(0,0,0,.08);
  border:1px solid #eee;
  overflow:hidden;
}

/* ——— SIDEBAR ——— */
.kp-sidebar {
  width:210px;
  background:#f7f8fa;
  border-right:1px solid #e7e7e7;
}
.kp-sidebar ul {
  list-style:none;
  padding:0;
  margin:0;
}
.kp-sidebar li {
  padding:14px 16px;
  cursor:pointer;
  font-weight:600;
  color:#333;
  border-bottom:1px solid #eee;
  transition:background .2s ease, color .2s ease, padding-left .2s ease;
  outline:none;
}
.kp-sidebar li:hover,
.kp-sidebar li:focus {
  background:#efefef;
  padding-left:18px;
}
.kp-sidebar li.active {
  background:#ED1C24;
  color:#fff;
}

/* ——— SUBMENU ——— */
.kp-sidebar li.has-submenu {
  padding: 0;
  position: relative;
}

.kp-sidebar li.has-submenu .menu-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background .2s ease, padding-left .2s ease;
}

.kp-sidebar li.has-submenu:hover .menu-item-content {
  background: #efefef;
  padding-left: 18px;
}

.kp-sidebar li.has-submenu.active > .menu-item-content {
  background: #ED1C24;
  color: #fff;
}

.kp-sidebar .submenu-arrow {
  font-size: 12px;
  transition: transform .3s ease;
  margin-left: auto;
}

.kp-sidebar li.has-submenu.open .submenu-arrow {
  transform: rotate(180deg);
}

.kp-sidebar .submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  background: #eee;
}

.kp-sidebar li.has-submenu.open .submenu {
  max-height: 500px;
}

.kp-sidebar .submenu li {
  padding: 12px 16px 12px 28px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid #ddd;
  transition: background .2s ease, padding-left .2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kp-sidebar .submenu li:hover {
  background: #e0e0e0;
  padding-left: 30px;
}

.kp-sidebar .submenu li.active {
  background: #ED1C24;
  color: #fff;
}

.kp-sidebar .submenu li i {
  margin-right: 8px;
  font-size: 13px;
  width: 16px;
  display: inline-block;
  text-align: center;
}

.kp-sidebar .submenu li .kp-menu-new-badge,
.submenu-modal-wrapper .submenu li .kp-menu-new-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ED1C24;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.2;
  vertical-align: middle;
}

.kp-sidebar .submenu li.active .kp-menu-new-badge,
.submenu-modal-wrapper .submenu li.active .kp-menu-new-badge {
  background: #fff;
  color: #ED1C24;
}

/* Zapobiega łamaniu się etykiety "Przegląd ogólny" na dwie linie */
.kp-sidebar .submenu li[data-submenu="overview"] {
  white-space: nowrap !important;
}

.submenu-modal-wrapper .submenu li[data-submenu="overview"] {
  white-space: nowrap !important;
}

/* ——— CONTENT ——— */
.kp-content {
  flex:1;
  padding:24px;
}
.kp-content h2 {
  margin:0 0 6px;
  font-size:22px;
  line-height:1.3;
}
.kp-welcome p {
  margin:6px 0;
  color:#444;
}

/* Wrapper avatara */
.kp-usercard-left { position: relative; }
.kp-avatar-wrap {
  position: relative;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  background: #f2f3f5;
}

.kp-avatar-wrap .kp-usercard-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

#up-avatar-change {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #ED1C24;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: background .2s ease, transform .12s ease;
  z-index: 2;
}
#up-avatar-change i {
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.kp-avatar-wrap:hover { box-shadow: 0 6px 20px rgba(0,0,0,.20); }
.kp-usercard-welcome h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111;
}
.kp-usercard-welcome p {
  margin: 2px 0;
  font-size: 13px;
  color: #444;
}
.kp-usercard-welcome .kp-note {
  font-size: 12px;
  color: #666;
}

.kp-brand-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.kp-brand-desc {
  font-size: 13px;
  color: #666;
  margin: 0;
}

/* Kafelki */
.kp-tiles {
  display: grid;
  grid-template-columns: repeat( auto-fill, minmax(180px, 1fr) );
  gap: 14px;
  margin-top: 12px;
}
.kp-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.05);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.kp-tile i {
  font-size: 26px;
  color: #ED1C24;
}
.kp-tile span {
  font-weight: 700;
  color: #222;
}
.kp-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  border-color: #e6e6e6;
}

.kp-form label {
  display: block;
  margin: 10px 0;
  color: #333;
}
.kp-form input[type="time"],
.kp-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}
.kp-actions { display: flex; gap: 8px; margin-top: 8px; }

/* Avatar visible, no edit */
.kp-usercard-left,
.kp-avatar-wrap,
.kp-avatar-wrap .kp-usercard-avatar{
  display:block !important;
}

#up-avatar-change{
  display:none !important;
  pointer-events:none !important;
}

.kp-usercard-left{ position:relative; flex-shrink:0; }
.kp-avatar-wrap{
  width:94px; height:94px;
  border-radius:50%;
  overflow:hidden;
  background:#f2f3f5;
  box-shadow:0 4px 14px rgba(0,0,0,.12);
}
.kp-avatar-wrap .kp-usercard-avatar{
  width:100%; height:100%;
  object-fit:cover;
  border:0; border-radius:0;
  cursor:default;
}
.kp-avatar-wrap:hover{
  box-shadow:0 4px 14px rgba(0,0,0,.12);
  transform:none;
}

.kp-usercard{ gap:12px !important; }

/* ——— Responsive ——— */
@media (max-width:960px) {
  .kp-shell {
    flex-direction:column;
  }
  .kp-sidebar {
    width:100%;
    border-right:0;
    border-bottom:1px solid #e7e7e7;
  }
  .kp-sidebar li {
    display:inline-block;
    border-bottom:0;
    border-right:1px solid #eee;
  }
  .kp-sidebar ul {
    white-space:nowrap;
    overflow-x:auto;
  }
}

@media (max-width: 768px){
  .kp-topbar,
  .kp-shell,
  .kp-tile { box-shadow: 0 4px 14px rgba(0,0,0,.06); }
}

/* ——— MODAL SUBMENU NA MOBILE (dla wszystkich mobile do 960px) ——— */
@media (max-width: 960px) {
  /* Parent menu item - normalny wygląd */
  .kp-sidebar li.has-submenu {
    position: static;
  }

  .kp-sidebar li.has-submenu .menu-item-content {
    display: flex;
    align-items: center;
    cursor: pointer;
  }

  .kp-sidebar li.has-submenu .submenu-arrow {
    display: inline-block;
    margin-left: auto;
  }

  /* Ukryj submenu domyślnie */
  .kp-sidebar .submenu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
  }

  /* Overlay tło dla submenu - pojawi się nad wszystkim gdy otwarty */
  .kp-sidebar li.has-submenu.open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99998;
    animation: fadeIn 0.25s ease;
  }

  /* Pokaż submenu gdy parent ma klasę .open - modal wyśrodkowany na środku ekranu */
  .kp-sidebar li.has-submenu.open .submenu {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88vw;
    min-width: 280px;
    max-width: 420px;
    max-height: 75vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 3px solid #ED1C24;
    border-radius: 18px;
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(237, 28, 36, 0.2);
    z-index: 99999;
    white-space: normal;
    margin: 0;
    padding: 12px 0;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  @keyframes modalSlideIn {
    from {
      opacity: 0;
      transform: translate(-50%, -45%) scale(0.9);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  /* Elementy w submenu */
  .kp-sidebar .submenu li {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    border-right: 0;
    border-bottom: 1px solid #f5f5f5;
    white-space: normal;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 58px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  .kp-sidebar .submenu li i {
    margin-right: 12px;
    width: 22px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
  }

  .kp-sidebar .submenu li:first-child {
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
  }

  .kp-sidebar .submenu li:last-child {
    border-bottom: 0;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
  }

  .kp-sidebar .submenu li:active {
    background: #f0f0f0;
    transform: scale(0.98);
  }

  .kp-sidebar .submenu li.active {
    background: #ED1C24;
    color: #fff;
  }

  .kp-sidebar .submenu li.active i {
    color: #fff;
  }

  /* Scrollbar dla modala */
  .kp-sidebar .submenu::-webkit-scrollbar {
    width: 6px;
  }

  .kp-sidebar .submenu::-webkit-scrollbar-track {
    background: transparent;
  }

  .kp-sidebar .submenu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
  }
}

@media (max-width: 680px){
  .kp-topbar{
    gap:10px; padding:10px 12px; border-radius:10px;
  }
  .kp-logo{ width:30px; height:30px; border-radius:8px; font-size:12px; }
  .kp-appname{ font-size:14px; font-weight:800; }

  .kp-usercard{ gap:10px; }
  .kp-avatar-wrap{ width:72px; height:72px; }
  #up-avatar-change{ width:30px; height:30px; right:1px; bottom:1px; }
  .kp-usercard-name{ font-size:15px; }
  .kp-usercard-meta{ gap:6px; flex-wrap:wrap; }
  .kp-badge{ font-size:11px; padding:3px 8px; }

  .kp-shell{ flex-direction:column; border-radius:10px; }
  .kp-sidebar{ width:100%; border-right:0; border-bottom:1px solid #e7e7e7; }
  .kp-sidebar > ul{ white-space:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; padding:0; }
  .kp-sidebar > ul > li{ display:inline-block; border-bottom:0; border-right:1px solid #eee; padding:12px 14px; vertical-align:top; }

  /* Dostosowania submenu/modal dla średnich mobile */
  .kp-sidebar li.has-submenu .menu-item-content{
    padding:12px 14px;
  }

  .kp-sidebar li.has-submenu.open .submenu {
    width: 86vw;
    min-width: 270px;
    max-width: 360px;
    max-height: 70vh;
  }

  .kp-sidebar .submenu li {
    padding: 16px 20px;
    font-size: 14px;
    min-height: 54px;
  }

  .kp-sidebar .submenu li i {
    font-size: 15px;
  }

  .kp-content{ padding:16px; }

  .kp-tiles{ grid-template-columns: repeat( auto-fill, minmax(140px, 1fr) ); gap:10px; }
  .kp-tile{ padding:14px 12px; gap:8px; }
  .kp-tile i{ font-size:22px; }

  .kp-actions{ flex-direction:column; }
  .kp-actions .kp-btn-ghost{ width:100%; }
}

@media (max-width: 520px) {
  .kp-topbar {
    padding:10px 12px;
    border-radius:10px;
  }
  .kp-usercard-avatar {
    width:72px;
    height:72px;
  }
  .kp-content {
    padding:18px;
  }
}

@media (max-width: 768px){
  .kp-brand-info{ display:none; }
}

@media (max-width: 420px){
  .kp-appname{ display:none; }
  .kp-sidebar > ul > li{ padding:10px 12px; font-size:13px; }
  .kp-sidebar li.has-submenu .menu-item-content{ padding:10px 12px; font-size:13px; }
  .kp-sidebar .submenu-arrow{ font-size:10px; }
  
  /* Modal submenu dla bardzo małych iPhone (SE, 5S, 320-420px) */
  .kp-sidebar li.has-submenu.open .submenu {
    width: 92vw;
    min-width: 250px;
    max-width: 320px;
    max-height: 65vh;
    border-radius: 14px;
    padding: 10px 0;
  }

  .kp-sidebar .submenu li {
    padding: 15px 18px;
    font-size: 14px;
    min-height: 52px;
  }

  .kp-sidebar .submenu li i {
    margin-right: 10px;
    width: 20px;
    font-size: 14px;
  }
}

@media (max-width: 340px){
  .kp-topbar{ padding:8px 10px; }
  .kp-tiles{ grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; animation:none !important; }
}

/* Loading indicator */
.kp-loading {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

.kp-error {
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 8px;
  padding: 16px;
  color: #c33;
  margin: 20px 0;
}

/* ===== SUBMENU MODAL (renderowany w body dla mobile) ===== */
.submenu-modal-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.submenu-modal-container.visible {
  opacity: 1;
  pointer-events: all;
}

.submenu-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1;
}

.submenu-modal-wrapper {
  position: relative;
  z-index: 2;
  width: 88vw;
  max-width: 420px;
  max-height: 75vh;
  background: #fff;
  border: 3px solid #ED1C24;
  border-radius: 18px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(237, 28, 36, 0.2);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.submenu-modal-container.visible .submenu-modal-wrapper {
  transform: scale(1);
}

.submenu-modal-wrapper .submenu {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  max-height: 75vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.submenu-modal-wrapper .submenu li {
  display: flex;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 58px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  color: #333;
}

.submenu-modal-wrapper .submenu li i {
  margin-right: 12px;
  width: 22px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
  color: #666;
}

.submenu-modal-wrapper .submenu li:first-child {
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

.submenu-modal-wrapper .submenu li:last-child {
  border-bottom: 0;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

.submenu-modal-wrapper .submenu li:active {
  background: #f0f0f0;
  transform: scale(0.98);
}

.submenu-modal-wrapper .submenu li.active {
  background: #ED1C24;
  color: #fff;
}

.submenu-modal-wrapper .submenu li.active i {
  color: #fff;
}

/* Scrollbar dla modala submenu */
.submenu-modal-wrapper .submenu::-webkit-scrollbar {
  width: 6px;
}

.submenu-modal-wrapper .submenu::-webkit-scrollbar-track {
  background: transparent;
}

.submenu-modal-wrapper .submenu::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Responsywne rozmiary modala submenu */
@media (max-width: 680px) {
  .submenu-modal-wrapper {
    width: 86vw;
    max-width: 360px;
    max-height: 70vh;
  }

  .submenu-modal-wrapper .submenu li {
    padding: 16px 20px;
    font-size: 14px;
    min-height: 54px;
  }

  .submenu-modal-wrapper .submenu li i {
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .submenu-modal-wrapper {
    width: 92vw;
    max-width: 320px;
    max-height: 65vh;
    border-radius: 14px;
  }

  .submenu-modal-wrapper .submenu {
    padding: 10px 0;
  }

  .submenu-modal-wrapper .submenu li {
    padding: 15px 18px;
    font-size: 14px;
    min-height: 52px;
  }

  .submenu-modal-wrapper .submenu li i {
    margin-right: 10px;
    width: 20px;
    font-size: 14px;
  }
}

/* ===== PERFORMANCE - FILTRY WYKRESU ===== */
.perf-filters-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.perf-task-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
  flex: 1;
}

.perf-task-filter label {
  font-size: 13px;
  font-weight: 600;
  color: #5f6368;
  display: flex;
  align-items: center;
  gap: 6px;
}

.perf-task-filter label i {
  font-size: 12px;
}

.perf-task-select {
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.perf-task-select:hover {
  border-color: #ccc;
}

.perf-task-select:focus {
  border-color: #ED1C24;
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
}

/* ===== PERFORMANCE - KONTENER WYKRESU ===== */
.perf-chart-container {
  position: relative;
  width: 100%;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  margin-top: 16px;
  min-height: 300px;
}

.perf-chart-container canvas {
  max-width: 100%;
  height: auto !important;
}

/* Ukryj sekcję wykresu na mobile - nie ma sensu na małych ekranach */
@media (max-width: 768px) {
  .perf-section:has(.perf-chart-container) {
    display: none !important;
  }
}

  /* ===== TEAM REPORTS - RESPONSIVE ===== */
  @media (max-width: 768px) {
    .perf-filters-row {
      flex-direction: column;
      gap: 12px;
    }
    
    .perf-task-filter {
      min-width: 100%;
    }

    /* Category header - przegląd ogólny */
    .category-header {
      flex-direction: column !important;
      align-items: flex-start !important;
      gap: 16px !important;
    }

    .category-header__controls {
      width: 100% !important;
    }

    .date-selector {
      width: 100% !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 10px !important;
    }

    .date-selector label {
      width: 100% !important;
      justify-content: flex-start !important;
    }

    .date-selector input[type="date"] {
      width: 100% !important;
    }

    .date-selector .date-label {
      display: none !important;
    }
  }

  @media (max-width: 480px) {
    /* Category header - przegląd ogólny */
    .category-header {
      padding: 14px !important;
    }

    .category-header__icon {
      width: 44px !important;
      height: 44px !important;
      font-size: 18px !important;
    }

    .category-header__name {
      font-size: 18px !important;
    }

    .category-header__desc {
      font-size: 12px !important;
    }

    .date-selector {
      padding: 10px 12px !important;
      gap: 8px !important;
    }

    .date-selector label {
      font-size: 13px !important;
    }

    .date-selector input[type="date"] {
      font-size: 14px !important;
      padding: 10px !important;
    }
  }

/* ===== PERFORMANCE / WYDAJNOŚĆ - TABELA PRACOWNIKÓW W KARTACH ===== */

/* Sekcja pracowników */
.perf-employees-section {
  margin-bottom: 20px;
}

.perf-employees-section:last-child {
  margin-bottom: 0;
}

.perf-employees-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin: 0 0 12px 0;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #ED1C24;
  display: flex;
  align-items: center;
  gap: 8px;
}

.perf-employees-section-title i {
  font-size: 13px;
  color: #ED1C24;
}

/* Wrapper tabeli pracowników */
.perf-employees-table-wrapper {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.05);
}

/* Tabela pracowników */
.perf-employees-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.perf-employees-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f9fa;
}

.perf-employees-table th {
  padding: 10px 12px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #5f6368;
  border-bottom: 2px solid #e0e0e0;
  background: #f8f9fa;
}

.perf-employees-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background .15s ease;
}

.perf-employees-table tbody tr:hover {
  background: #f8f9fa;
}

.perf-employees-table tbody tr:last-child {
  border-bottom: none;
}

.perf-employees-table td {
  padding: 12px;
  vertical-align: middle;
  color: #333;
}

/* Komórka z nazwą pracownika */
.employee-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.employee-name-cell i {
  flex-shrink: 0;
}

.employee-name-cell span {
  font-weight: 600;
  color: #333;
}

/* Ranking mini (medale i numery) */
.rank-mini {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* Podium - top 3 */
.perf-employees-table tbody tr.rank-1 {
  background: linear-gradient(135deg, rgba(255,215,0,.08) 0%, rgba(255,215,0,.02) 100%);
}

.perf-employees-table tbody tr.rank-1:hover {
  background: linear-gradient(135deg, rgba(255,215,0,.12) 0%, rgba(255,215,0,.04) 100%);
}

.perf-employees-table tbody tr.rank-2 {
  background: linear-gradient(135deg, rgba(192,192,192,.08) 0%, rgba(192,192,192,.02) 100%);
}

.perf-employees-table tbody tr.rank-2:hover {
  background: linear-gradient(135deg, rgba(192,192,192,.12) 0%, rgba(192,192,192,.04) 100%);
}

.perf-employees-table tbody tr.rank-3 {
  background: linear-gradient(135deg, rgba(205,127,50,.08) 0%, rgba(205,127,50,.02) 100%);
}

.perf-employees-table tbody tr.rank-3:hover {
  background: linear-gradient(135deg, rgba(205,127,50,.12) 0%, rgba(205,127,50,.04) 100%);
}

/* Brak danych */
.no-employees {
  padding: 24px;
  text-align: center;
  color: #999;
  font-size: 13px;
  font-style: italic;
}

/* Scrollbar dla tabeli */
.perf-employees-table-wrapper::-webkit-scrollbar {
  width: 6px;
}

.perf-employees-table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.perf-employees-table-wrapper::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.perf-employees-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Responsywność dla tabeli pracowników */
@media (max-width: 768px) {
  .perf-employees-table {
    font-size: 12px;
  }

  .perf-employees-table th {
    padding: 8px 10px;
    font-size: 10px;
  }

  .perf-employees-table td {
    padding: 10px;
  }

  .employee-name-cell {
    gap: 6px;
  }

  .employee-name-cell i {
    font-size: 12px !important;
  }

  .rank-mini {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .perf-employees-table {
    font-size: 11px;
  }

  .perf-employees-table th {
    padding: 6px 8px;
  }

  .perf-employees-table td {
    padding: 8px;
  }

  .perf-employees-table-wrapper {
    max-height: 280px;
  }
}

/* ===== PAGINACJA ===== */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  padding: 16px;
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination button,
.pagination span {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination button:hover {
  background: #f8f9fa;
  border-color: #ED1C24;
  color: #ED1C24;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .current-page {
  background: #ED1C24;
  color: #fff;
  border-color: #ED1C24;
}

/* ===== SEKCJA UWAGI ===== */
.notes-section,
.general-notes-section,
.report-notes-section {
  margin: 20px 0;
  padding: 16px;
  background: #fff9e6;
  border-left: 4px solid #f57c00;
  border-radius: 8px;
}

.notes-section h4,
.general-notes-section h4,
.report-notes-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 700;
  color: #f57c00;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.notes-section h4 i,
.general-notes-section h4 i,
.report-notes-section h4 i {
  font-size: 13px;
}

.notes-content,
.general-notes-content {
  font-size: 14px;
  line-height: 1.6;
  color: #5f6368;
  text-align: center;
}

/* Mobile - wyśrodkowanie paginacji i uwag */
@media (max-width: 768px) {
  .pagination-wrapper {
    padding: 12px;
    margin: 16px 0;
  }

  .pagination {
    justify-content: center;
    gap: 6px;
  }

  .pagination button,
  .pagination span {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 36px;
    text-align: center;
  }

  .notes-section,
  .general-notes-section,
  .report-notes-section {
    margin: 16px 0;
    padding: 14px;
    text-align: center;
  }

  .notes-section h4,
  .general-notes-section h4,
  .report-notes-section h4 {
    justify-content: center;
    font-size: 13px;
  }

  .notes-content,
  .general-notes-content {
    font-size: 13px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .pagination button,
  .pagination span {
    padding: 5px 8px;
    font-size: 12px;
    min-width: 32px;
  }

  .notes-section,
  .general-notes-section,
  .report-notes-section {
    padding: 12px;
  }
}

/* ===== PERFORMANCE - TABELE RAPORTÓW ===== */

/* Wrapper pojedynczej tabeli raportu */
.report-table-wrapper {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.report-table-wrapper:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* Nagłówek tabeli raportu */
.report-table-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e0e0e0;
}

.report-table-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #202124;
}

.report-table-user i {
  font-size: 20px;
}

.report-table-meta {
  display: flex;
  gap: 20px;
  align-items: center;
}

.report-table-date,
.report-table-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #5f6368;
  font-weight: 500;
}

.report-table-date i,
.report-table-time i {
  font-size: 12px;
}

/* Tabela szczegółów raportu */
.report-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.report-details-table thead {
  background: #f8f9fa;
}

.report-details-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5f6368;
  border-bottom: 2px solid #e0e0e0;
}

.report-details-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s ease;
}

.report-details-table tbody tr:hover {
  background: #f8f9fa;
}

.report-details-table tbody tr:last-child {
  border-bottom: none;
}

.report-details-table td {
  padding: 14px 16px;
  vertical-align: top;
  color: #333;
}

.report-table-category {
  font-weight: 600;
  color: #202124;
}

.report-table-qty {
  text-align: center;
  font-size: 15px;
}

.report-table-notes {
  color: #5f6368;
  font-size: 13px;
  line-height: 1.6;
}

/* Wiersz z uwagami ogólnymi */
.report-general-notes-row {
  background: #fff9e6 !important;
}

.report-general-notes-cell {
  padding: 4px 0;
}

.report-general-notes-cell strong {
  display: block;
  margin-bottom: 8px;
  color: #f57c00;
  font-size: 13px;
}

.report-general-notes-cell strong i {
  margin-right: 6px;
}

.report-general-notes-text {
  color: #5f6368;
  font-size: 13px;
  line-height: 1.6;
  padding-left: 24px;
}

/* Wrapper dla scrollującej się tabeli */
.report-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar dla tabeli */
.report-table-scroll::-webkit-scrollbar {
  height: 8px;
}

.report-table-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.report-table-scroll::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.report-table-scroll::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Responsywność dla tabel raportów */
@media (max-width: 768px) {
  .report-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .report-table-meta {
    gap: 15px;
  }

  .report-table-user {
    font-size: 15px;
  }

  .report-table-user i {
    font-size: 18px;
  }

  .report-details-table {
    min-width: 600px;
    font-size: 13px;
  }

  .report-details-table th {
    padding: 10px 12px;
    font-size: 11px;
    white-space: nowrap;
  }

  .report-details-table td {
    padding: 12px;
    white-space: nowrap;
  }

  .report-details-table td.report-table-notes {
    white-space: normal;
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .report-table-wrapper {
    border-radius: 8px;
    margin-bottom: 16px;
  }

  .report-table-header {
    padding: 12px 14px;
  }

  .report-table-user {
    font-size: 14px;
  }

  .report-table-user i {
    font-size: 16px;
  }

  .report-table-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .report-table-date,
  .report-table-time {
    font-size: 12px;
  }

  .report-details-table {
    min-width: 550px;
    font-size: 12px;
  }

  .report-details-table th {
    padding: 8px 10px;
    font-size: 10px;
  }

  .report-details-table td {
    padding: 10px;
  }

  .report-details-table td.report-table-notes {
    max-width: 180px;
  }
}
