/* ==========================================================================
   Zmienne CSS (dla dark mode i drukowania)
   ========================================================================== */
   :root {
    --dark-bg: #121212;
    --dark-table-bg: #1e1e1e;
    --dark-table-header: #333333;
    --dark-border: #444444;
    --dark-hover: #444444;
    --print-table-border-color: #888888; /* Kolor obramowania tabel w druku */
  }
  
  /* ==========================================================================
     Ogólne style dla strony (bez zmian w tej sekcji)
     ========================================================================== */
  body {
    font-family: "Poppins", sans-serif;
  }
  .print-visible {
    display:none;
  }
  h1 {
    font-size: 1.2rem;
    font-weight: 900;
  }
  
  h3 {
    font-size: 1.0rem;
    font-weight: 700;
    margin-bottom: 25px;
    margin-top: 40px;
  }
  
  h4 {
    font-size: 1.0rem;
  }
  
  hr {
    margin: 3rem 0;
  }
  
  .btn {
    border-radius: 20px !important;
    font-size: 0.85em !important;
    font-weight: 700 !important;
  }
  
  .btn-alternative {
    padding: 0 10px;
  }
  
  .btn-info,
  .btn-warning {
    color: #fff !important;
  }
  
  .btn-top {
    margin-bottom: 20px;
    margin-top: 10px;
  }
  
  .content-container {
    background-color: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 15px;
    box-shadow: 1px 1px 5px #eee;
    margin-bottom: 30px;
    padding: 20px;
  }
  
  .page-content {
    color: #363636;
    font-size: 0.75em;
  }
  
  .layout-container {
    height: 100vh;
    overflow-x: hidden;
    width: 100vw;
  }
  
  .layout-sidebar {
    float: left;
    height: 100%;
    position: relative;
    width: 275px;
    transition: width 0.3s ease;
  }
  
  .layout-main {
    float: left;
    min-height: 100%;
    position: relative;
    width: calc(100% - 275px);
    transition: width 0.3s ease;
  }
  
  .layout-main-content {
    padding: 20px;
  }
  
  /* ==========================================================================
     Style dla trybu ciemnego (dark mode) - bez zmian
     ========================================================================== */
  body.dark-mode {
    background-color: var(--dark-bg);
    color: #ffffff;
  }
  
  html.dark-mode body {
    background-color: var(--dark-bg) !important;
    color: #ffffff !important;
  }
  
  html.dark-mode a {
    color: #ffffff !important;
  }
  
  html.dark-mode header {
    background-color: var(--dark-bg);
  }
  
  html.dark-mode .btn-toggle {
    color: #fff;
  }
  
  html.dark-mode .btn-toggle:hover,
  html.dark-mode .btn-toggle:focus {
    background-color: var(--dark-bg);
    color: #fff;
  }
  
  html.dark-mode .btn-toggle-nav a:hover,
  html.dark-mode .btn-toggle-nav a:focus {
    background-color: var(--dark-bg);
    color: #ddd !important;
  }
  
  html.dark-mode .content-container {
    background-color: inherit;
    border: inherit;
    box-shadow: inherit;
    color: #ffffff;
  }
  
  html.dark-mode .dashboard-logo {
    background: url(/images/m2online-white-s.webp);
    background-size: cover;
    height: 58px;
    margin-left: 17px;
    width: 150px;
  }
  
  html.dark-mode .disabled > .page-link {
    background-color: var(--dark-border);
    border-color: var(--dark-border);
  }
  
  /* ==========================================================================
     Style dla tabel - bez zmian poza drukowaniem
     ========================================================================== */
  .table {
    vertical-align: middle !important;
  }
  
  .table > :not(caption) > * > * {
    padding: 0.15rem 0.5rem !important;
  }
  
  .table-bordered {
    border: 1px solid #b5b6b7;
  }
  
  .table-consistent-columns {
    table-layout: auto;
    width: 100%;
  }
  
  .table-font {
    font-size: 0.95em;
  }
  
  .table-font-normal {
    font-size: 1em;
  }
  
  .font-table-small {
    font-size: 0.9em;
  }
  
  .font-table-xsmall {
    font-size: 0.85em;
  }
  
  .table-nonfluid {
    width: auto !important;
  }
  
  .table-responsive {
    display: table;
    width: 100%;
  }
  
  .col-narrow {
    white-space: nowrap;
    width: 8%;
  }
  
  .col-wide {
    width: 17%;
    word-break: break-word;
  }
  
  .col-half {
    width: 25%;
    word-break: break-word;
  }
  
  .cost-column {
    max-width: 87px;
  }
  
  .expenses-column-number {
    width: 30px !important;
  }
  
  .expenses-column-invoice {
    width: 160px !important;
  }
  
  .expenses-column-client {
    width: 420px !important;
  }
  
  .expenses-column-amount {
    width: 110px !important;
  }
  
  .expenses-column-date {
    width: 110px !important;
  }
  
  .expenses-column-payment {
    width: 110px !important;
  }
  
  .expenses-column-desc {
    width: 500px !important;
  }
  
  .expenses-column-action {
    width: 180px !important;
  }
  
  .expenses-column-property {
    width: 180px !important;
  }
  
  .table-bank-date {
    min-width: 150px;
    width: 10%;
  }
  
  .table-bank-description {
    min-width: 250px;
    width: 35%;
  }
  
  .table-bank-amount {
    min-width: 150px;
    width: 9%;
  }
  
  .table-bank-balance {
    min-width: 150px;
    width: 9%;
  }
  
  .payment-table th,
  .payment-table td {
    width: 25%;
  }
  
  .payment-table th:first-child,
  .payment-table td:first-child {
    width: 20%;
  }
  
  .payment-table th:nth-child(2),
  .payment-table td:nth-child(2) {
    width: 20%;
  }
  
  .payment-table th:nth-child(3),
  .payment-table td:nth-child(3) {
    width: 20%;
  }
  
  .payment-table th:nth-child(4),
  .payment-table td:nth-child(4) {
    width: 20%;
  }
  
  .payment-table th:nth-child(5),
  .payment-table td:nth-child(5) {
    width: 20%;
  }
  
  .cold-water {
    --bs-table-bg: #e0f7fa;
  }
  
  .hot-water {
    --bs-table-bg: #ffebee;
  }
  
  .cell-inactive {
    --bs-table-bg: #eeeeee !important;
  }
  
  .highlighted {
    --bs-table-bg: #d4edda !important;
    transition: all 3s ease;
  }
  
  /* Tryb ciemny dla tabel */
  html.dark-mode .table {
    background-color: var(--dark-table-bg) !important;
    border-color: var(--dark-border) !important;
    color: #ffffff !important;
    --bs-table-bg: inherit;
    --bs-table-color: inherit;
  }
  
  html.dark-mode .table thead {
    background-color: var(--dark-table-header) !important;
    color: #ffffff !important;
  }
  
  html.dark-mode .table tbody tr:nth-child(odd) {
    background-color: #2a2a2a;
  }
  
  html.dark-mode .table tbody tr:nth-child(even) {
    background-color: #252525;
  }
  
  html.dark-mode .table tbody tr:hover {
    background-color: var(--dark-hover);
  }
  
  html.dark-mode .table-bordered {
    border: 1px solid var(--dark-border);
  }
  
  html.dark-mode .table thead th {
    border-bottom: 2px solid var(--dark-border);
  }
  
  html.dark-mode .table td,
  html.dark-mode .table th {
    border-color: var(--dark-border);
  }
  
  html.dark-mode .table-secondary {
    --bs-table-bg: inherit;
    --bs-table-color: inherit;
  }
  
  /* ==========================================================================
     Style dla komponentów specyficznych - bez zmian
     ========================================================================== */
  .active {
    font-weight: 700;
  }
  
  .community-header {
    font-size: 14px;
    line-height: 1.2;
    margin-bottom: 10px;
  }
  
  .dashboard-logo {
    background: url(/images/m2online-black-s.webp);
    background-size: cover;
    height: 58px;
    margin-left: -10px;
    width: 150px;
  }
  
  .dashboard-start h2 {
    color: #999;
    font-size: 14px;
  }
  .dashboard-start h3 {
    margin-top:0px;
    color: #000;
    font-size: 16px;
  }
  
  .dashboard-start .counter {
    font-size: 30px;
    font-weight: 800;
  }
  
  .dashboard-start-icon {
    border-radius: 60px;
    height: 70px;
    padding: 15px;
    width: 70px;
  }
  
  .dashboard-start-icon img {
    width: 100%;
  }
  
  .icon-issues {
    background-color: #fff5d9;
  }
  
  .content-container-25 {
    background-color: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 15px;
    box-shadow: 1px 1px 5px #eee;
    float: left;
    margin-bottom: 30px;
    padding: 30px;
    width: calc(25% - 30px);
  }
  .content-container-50 {
    background-color: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 15px;
    box-shadow: 1px 1px 5px #eee;
    float: left;
    margin-bottom: 30px;
    padding: 30px;
    width: calc(50% - 30px);
  }
  
  .content-container-100 {
    background-color: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 15px;
    box-shadow: 1px 1px 5px #eee;
    float: left;
    margin-bottom: 30px;
    padding: 30px;
    width: 100%;
  }
  .property-card {
    margin-bottom: 20px;
    position: relative;
  }
  
  .property-owner-address {
    text-align: center;
  }
  
  .property-owner-address p {
    margin-bottom: 0;
  }
  
  .individual-settlement-address p {
    margin-bottom: 0;
  }
  
  .no-data {
    color: #ff0000 !important;
  }
  
  .hidden {
    display: none;
  }
  
  .fixed-width {
    max-width: 100px;
  }
  
  .fade-out {
    opacity: 1;
    transition: opacity 2s ease-out;
  }
  
  .fade-out.hide {
    opacity: 0;
  }
  
  .font-bold {
    font-weight: 900;
  }
  
  .form-font-m {
    font-size: 0.7rem;
  }
  
  .form-meters-edit {
    font-size: 11px;
    padding-bottom: 1px;
    padding-top: 1px;
  }
  
  .form-meters-records {
    text-align: center;
    width: 100px;
  }
  
  .owner-name-input,
  .owner-start-date-input {
    font-size: 0.75rem !important;
  }
  
  .property-selector {
    appearance: none;
    background: transparent;
    border: none;
    color: #212529;
    cursor: pointer;
    font-weight: normal;
    outline: none;
    padding: 0;
  }
  .modal-content {
    margin: 5% auto !important;
  }
  .property-selector:focus {
    appearance: auto;
    background: white;
    border: 1px solid #007bff;
    padding: 2px 4px;
  }
  
  .record-inactive {
    opacity: 0.55;
  }
  
  .sidebar-navigation {
    padding: 10px !important;
    position: relative;
    height:100vh;
  }
  
  .m2-logo-leftside {
    margin-left: 10px;
  }
  
  .top-header {
    height: 85px;
    padding: 24px !important;
  }
  
  .printer-icon {
    cursor: pointer;
    height: 24px;
    transition: opacity 0.3s;
    width: 24px;
  }
  
  .printer-icon:hover {
    opacity: 0.7;
  }
  
  /* ==========================================================================
     Style dla przycisków drukowania - bez zmian
     ========================================================================== */
  .print-btn {
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin: 20px 5px;
    padding: 10px 20px;
  }
  
  .print-btn:hover {
    background-color: #0056b3;
  }
  
  .single-print-btn {
    font-size: 14px;
    padding: 5px 10px;
  }
  
  /* ==========================================================================
     Style dla przełącznika (switch) - bez zmian
     ========================================================================== */
  .switch {
    display: inline-block;
    height: 25px;
    position: relative;
    width: 50px;
  }
  
  .switch input {
    height: 0;
    opacity: 0;
    width: 0;
  }
  
  .slider {
    background-color: #ccc;
    border-radius: 25px;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: 0.4s;
  }
  
  .slider:before {
    background-color: white;
    border-radius: 50%;
    bottom: 3px;
    content: "";
    height: 19px;
    left: 3px;
    position: absolute;
    transition: 0.4s;
    width: 19px;
  }
  
  input:checked + .slider {
    background-color: #4caf50;
  }
  
  input:checked + .slider:before {
    transform: translateX(25px);
  }
  
  .dark-mode-toggle {
    margin-right: 30px;
  }
  
  /* ==========================================================================
     Style dla modalu - bez zmian
     ========================================================================== */
  .modal {
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    height: 100%;
    justify-content: center;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
  }
  
  .modal-content {
    background-color: #fff;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    width: 450px;
  }
  
  .modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
  }
  
  .btn-confirm,
  .btn-cancel {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 8px 12px;
  }
  
  .btn-confirm {
    background-color: #dc3545;
    color: white;
  }
  
  .btn-cancel {
    background-color: #6c757d;
    color: white;
  }
  
  /* ==========================================================================
     Style dla drukowania
     ========================================================================== */
  @media print {
    body {
      font-size: 5px;
    }
  
    body * {
      visibility: visible;
    }
  
    #print-content,
    #print-content * {
      visibility: visible;
    }
  
    #print-content {
      height: 100%;
      left: 0;
      position: absolute;
      top: 0;
      width: 100%;
      page-break-inside: avoid;
    }
  
  
    .payment-info-card h5 {
      margin-bottom: 5px;
      text-align: center;
    }
  
    .payment-info-card h6 {
      margin-bottom: 10px;
      text-align: center;
    }
  
    .payment-info-card {
      margin-bottom: 20mm;
      page-break-inside: avoid;
    }
  
    .print-btn,
    .single-print-btn {
      display: none;
    }
  
    .property-card {
      page-break-inside: avoid;
      page-break-after: always;
    }
  
    table {
      border-collapse: collapse;
      font-size: 1rem; /* Ujednolicony rozmiar */
      table-layout: fixed;
      width: 100%;
    }
  
    th,
    td {
      border: 1px solid var(--print-table-border-color);
      font-size: 1rem; /* Ujednolicony rozmiar */
      overflow: hidden;
      padding: 5px !important;
      word-wrap: break-word;
    }
  
    .table > :not(caption) > * > * {
      padding: 1px !important;
    }
  
    .form-meters-records {
      width: inherit !important;
    }
  
    .individual-settlement {
      page-break-before: always;
    }
  
    @page {
      margin: 20mm;
      size: A4 portrait;
    }
  
    /* Ukryj sidebar w print nawet w collapsed */
    .layout-sidebar {
      display: none !important;
    }
  
    .layout-main {
      width: 100% !important;
    }
  }
  
  /* Drukowanie planu gospodarczego */
  @media print and (class="economic-plan-print") {
    body * {
      visibility: hidden;
    }
  
    #print-content,
    #print-content * {
      visibility: visible;
    }
  
    #print-content {
      left: 0;
      position: absolute;
      top: 0;
      width: 100%;
    }
  
    #management-costs-section {
      page-break-after: always;
    }
  
    .print-btn,
    .single-print-btn {
      display: none;
    }
  
    @page {
      margin: 20mm;
      size: A4 portrait;
    }
  }
  
  /* Drukowanie informacji o zaliczkach i pojedynczych kart */
  @media print and (class="payment-notices-print") {
    body * {
      visibility: hidden;
    }
  
    #print-content,
    #print-content * {
      visibility: visible;
    }
  
    #print-content {
      left: 0;
      position: absolute;
      top: 0;
      width: 100%;
    }
  
    .property-card {
      page-break-after: always;
      page-break-inside: avoid;
    }
  
    .single-print-btn,
    .print-btn {
      display: none;
    }
  
    @page {
      margin: 20mm;
      size: A4 portrait;
    }
  }

  /* Style dla collapsed sidebar */
  body.sidebar-collapsed .layout-sidebar {
    width: 70px;
    overflow: hidden;
  }

  body.sidebar-collapsed .layout-main {
    width: calc(100% - 70px);
  }

  /* Hover: Wysuwanie na pełną szerokość */
  body.sidebar-collapsed.sidebar-expanded .layout-sidebar {
    width: 280px;
    overflow: visible;
  }

  body.sidebar-collapsed.sidebar-expanded .layout-main {
    width: calc(100% - 280px);
  }

  /* Ukrywanie tekstu w collapsed */
  body.sidebar-collapsed .btn-toggle:not(.hamburger-icon), 
  body.sidebar-collapsed .btn-toggle-nav a {
    display: none;
  }

  /* Dark mode dla collapsed sidebar */
  html.dark-mode body.sidebar-collapsed .layout-sidebar {
    background-color: var(--dark-bg);
  }

  /* Switch dla sidebar */
  .sidebar-toggle {
    margin-bottom: 20px;
    text-align: left; /* Wyrównaj do lewej */
    display: flex;
    justify-content: flex-start;
  }

  .sidebar-toggle .switch input:checked + .slider {
    background-color: #2196f3;
  }

  /* Opacity dla menu items */
  .sidebar-menu-items {
    opacity: 1;
    transition: opacity 0.5s ease;
  }

  body.sidebar-collapsed .sidebar-menu-items {
    opacity: 0;
  }

  body.sidebar-collapsed.sidebar-expanded .sidebar-menu-items {
    opacity: 1;
  }

  /* Styl dla switcha na dole */
  .sidebar-bottom-switch {
    position: absolute;
    bottom: 0;
  }