/* ==============================================================
   KADRA INTRANET – MOBILE CSS v9.2
   MINIMALNE MARGINESY - PEŁNA SZEROKOŚĆ
   ============================================================== */

/* =============================================
   PODSTAWY - MINIMALNE PADDINGI
   ============================================= */

@media (max-width: 1024px) {
  :root {
    --mob-gutter: 8px;
    --color-primary: #d0393f;
  }

  body {
    padding-top: 68px !important;
    overflow-x: hidden !important;
  }

  .is-left-sidebar-fixed {
    display: none !important;
  }

  /* MINIMALNE PADDINGI - 8px */
  #page-wrapper,
  .is-center-content,
  #content-container,
  #content,
  .content-area,
  .main-content,
  #main-content,
  article.hentry {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
  }

  /* Tytuł strony */
  .post-title,
  h1.post-title {
    font-size: 1.35rem !important;
    margin: 12px 0 16px 0 !important;
    line-height: 1.3 !important;
    padding: 0 !important;
  }

  #main-header .navbar,
  .main-header .navbar {
    display: none !important;
  }
}

/* =============================================
   DASHBOARD BOXY
   ============================================= */

@media (max-width: 768px) {
  .dashboard-box,
  .kw-historia-box,
  .kf-polityka-box {
    padding: 12px !important;
    margin: 12px 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
  }

  .dashboard-box h3,
  .box-title {
    font-size: 1rem !important;
    margin-bottom: 12px !important;
  }
}

/* =============================================
   FORMULARZE
   ============================================= */

@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  select,
  textarea {
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 10px 12px !important;
    font-size: 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-sizing: border-box !important;
  }

  input:focus,
  select:focus {
    border-color: var(--color-primary) !important;
    outline: none !important;
  }

  button,
  input[type="submit"],
  .kw-btn,
  .kf-btn {
    width: 100% !important;
    height: 46px !important;
    padding: 10px 18px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
  }

  .kw-btn-primary,
  .kf-btn-primary,
  button[type="submit"] {
    background: var(--color-primary) !important;
    color: #fff !important;
    border: none !important;
  }
}

/* =============================================
   START / DASHBOARD
   ============================================= */

@media (max-width: 768px) {
  .dashboard-greeting-row {
    flex-direction: row !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .dashboard-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }

  .dashboard-hello {
    font-size: 1.1rem !important;
    margin: 0 0 2px 0 !important;
  }

  .dashboard-intro {
    font-size: 0.8rem !important;
    color: #64748b !important;
  }

  /* Ważne linki */
  .dashboard-links,
  .important-links,
  .wazne-linki-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .dashboard-links a,
  .important-links a,
  .dashboard-link-item {
    padding: 10px 12px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
    text-decoration: none !important;
  }
}

/* =============================================
   MOJE WYDARZENIA
   ============================================= */

@media (max-width: 768px) {
  .kw-my-events-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .kw-my-event-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 12px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
  }

  .kw-my-event-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 !important;
  }

  .kw-my-event-meta {
    font-size: 11px !important;
    color: #64748b !important;
  }

  .kw-my-event-status {
    padding: 3px 8px !important;
    border-radius: 5px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    width: fit-content !important;
  }

  .kw-my-event-actions .kw-btn {
    width: 100% !important;
  }
}

/* =============================================
   HISTORIA WYDARZEŃ
   ============================================= */

@media (max-width: 768px) {
  .kw-historia-filters,
  .kw-filter-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .kw-filter-field {
    width: 100% !important;
  }

  .kw-filter-field label {
    display: block !important;
    margin-bottom: 4px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
  }

  .kw-filter-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .kw-historia-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .kw-historia-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 10px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
  }

  .kw-historia-thumb {
    width: 100% !important;
    height: 120px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }

  .kw-historia-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .kw-historia-date {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 5px 8px !important;
    background: #fff !important;
    border-radius: 6px !important;
    border: 1px solid #e2e8f0 !important;
    width: fit-content !important;
  }

  .kw-historia-date .kw-date-day {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--color-primary) !important;
  }

  .kw-historia-date .kw-date-month {
    font-size: 10px !important;
    color: #64748b !important;
  }

  .kw-historia-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 !important;
  }

  .kw-historia-meta {
    font-size: 11px !important;
    color: #64748b !important;
  }

  .kw-pagination {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-top: 14px !important;
  }

  .kw-page-btn {
    width: 100% !important;
    text-align: center !important;
  }
}

/* =============================================
   DOKUMENTY
   ============================================= */

@media (max-width: 768px) {
  .dok-filtrowanie-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 12px !important;
  }

  .dok-search-wrapper,
  .dok-select-wrapper {
    width: 100% !important;
  }

  .dok-search-wrapper label,
  .dok-select-wrapper label {
    display: block !important;
    margin-bottom: 4px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
  }

  .dok-lista {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .dok-lista-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 12px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
  }

  .dok-lista-icon {
    width: 40px !important;
    height: 40px !important;
    background: var(--color-primary) !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    flex-shrink: 0 !important;
  }

  .dok-lista-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 !important;
  }

  .dok-lista-meta {
    font-size: 11px !important;
    color: #64748b !important;
  }

  .dok-btn-link {
    width: 100% !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    background: var(--color-primary) !important;
    color: #fff !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-decoration: none !important;
  }
}

/* =============================================
   POLITYKA FIRM
   ============================================= */

@media (max-width: 768px) {
  .kf-search-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .kf-alphabet {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
    padding: 8px !important;
    justify-content: center !important;
  }

  .kf-letter {
    min-width: 30px !important;
    height: 30px !important;
    font-size: 11px !important;
    border-radius: 5px !important;
  }

  .kf-letter.active {
    background: var(--color-primary) !important;
    color: #fff !important;
  }

  .kf-firma-lista {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .kf-firma-item {
    display: flex !important;
    gap: 10px !important;
    padding: 10px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    align-items: flex-start !important;
  }

  .kf-firma-logo-small,
  .kf-firma-initial {
    width: 42px !important;
    height: 42px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
    background: #f1f5f9 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--color-primary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .kf-firma-name {
    font-size: 13px !important;
    font-weight: 600 !important;
    margin: 0 0 2px 0 !important;
  }

  .kf-firma-excerpt {
    font-size: 11px !important;
    color: #64748b !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .kf-single-firma {
    padding: 12px !important;
  }

  .kf-firma-header {
    flex-direction: column !important;
    text-align: center !important;
    gap: 12px !important;
  }

  .kf-firma-logo {
    max-width: 90px !important;
    margin: 0 auto !important;
  }

  .kf-firma-title {
    font-size: 1.1rem !important;
  }
}

/* =============================================
   DIALOG SPOŁECZNY (osobna strona)
   ============================================= */

@media (max-width: 768px) {
  .dialog-tiles {
    gap: 6px !important;
  }

  .dialog-tile {
    padding: 10px 12px !important;
    font-size: 13px !important;
    gap: 10px !important;
    border-radius: 8px !important;
  }

  .dialog-tile-icon {
    width: 30px !important;
    height: 30px !important;
    flex-shrink: 0 !important;
  }

  .dialog-tile-icon svg {
    width: 16px !important;
    height: 16px !important;
  }

  .dialog-tile:hover {
    transform: none !important;
  }
}

/* =============================================
   MÓJ PROFIL
   ============================================= */

@media (max-width: 768px) {
  .profil-header {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
  }

  .profil-avatar {
    width: 60px !important;
    height: 60px !important;
    margin: 0 auto !important;
  }

  .profil-hello {
    font-size: 1.1rem !important;
  }

  .profil-data-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .profil-pass-form {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .profil-pass-form input[type="password"] {
    width: 100% !important;
  }

  .profil-pass-form button[type="submit"] {
    width: 100% !important;
  }

  .profil-logout-link {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* =============================================
   UKRYJ NA MOBILE
   ============================================= */

@media (max-width: 768px) {
  .hide-mobile,
  .desktop-only {
    display: none !important;
  }
}

/* =============================================
   ACCESSIBILITY
   ============================================= */

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