/* FG17.7.25 Schriftgrössen an 'normale' Browser-Schriftgrössen angepasst (body1 16px). Zusätzliche Styles für Tabellen */ 
html {
    height: 100%;
}

body {
    background-color: #F9F8F5; /* Off-White */
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    color: #1C1D20; /* Off-Black */
    font-size: 16px; /* Browser-Standardgröße für normale Texte */
    display: flex;
    flex-direction: column;
}

/* Navigation Bar */

/* Hide username and tenant on small screens */
@media (max-width: 500.98px) {
  .navbar-userinfo {
    display: none !important;
  }
}

/* Ensure Bootstrap hamburger icon is visible on light navbar */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(28,29,32, 0.85)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler {
    border-color: #1C1D20; /* off-black border for contrast */
}

.navbar {
    background-color: #E8E3D9; /* Neutral Beige/Taupe */
    padding: 10px 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.container-fluid {
    display: flex;
    align-items: center;
}

.logo-link {
    display: inline-block;
}

.logo {
    width: 220px; /* Scaled down from 660px for better fit */
    height: auto;
}

.navbar-brand {
    font-size: 16px; /* Anstatt 19px, Browser-Standard */
    font-weight: 500;
    letter-spacing: -4%;
    line-height: 22px; /* Angepasst */
    color: #0865FF; /* Royal Blue */
    text-decoration: none;
    margin-left: 0.25rem; /*FG20.7.25 0.25rem statt 20px um das Logo links bündig mit dem Content zu machen*/
}

.navbar-brand:hover {
    color: #0153CC; /* Dunkelblau for hover */
}

.view-name {
    font-size: 16px; /* Anstatt 18px, Browser-Standard */
    font-weight: 500;
    letter-spacing: -3%;
    line-height: 22px; /* Angepasst */
    color: #1C1D20; /* Off-Black */
    margin-left: 20px;
}

/* Typography */
.headline1 {
    font-size: 32px; /* Reduziert von 49px */
    font-weight: 500;
    letter-spacing: -2.8%;
    line-height: 38px; /* Angepasst für bessere Lesbarkeit */
    color: #0865FF; /* Royal Blue */
}

.headline2 {
    font-size: 28px; /* Reduziert von 42px */
    font-weight: 500;
    letter-spacing: -4%;
    line-height: 34px; /* Angepasst */
    color: #0865FF;
}

.headline3 {
    font-size: 24px; /* Reduziert von 31px */
    font-weight: 500;
    letter-spacing: -3%;
    line-height: 30px; /* Angepasst */
    color: #0865FF;
}

.headline4 {
    font-size: 20px; /* Erhöht von 18px, um Hierarchie zu wahren */
    font-weight: 500;
    letter-spacing: -3%;
    line-height: 26px;
    color: #0865FF;
}

.subtitle {
    font-size: 18px; /* Reduziert von 19px */
    font-weight: 500;
    letter-spacing: -4%;
    line-height: 24px; /* Angepasst */
    color: #1C1D20;
}

.overline {
    font-size: 14px; /* Erhöht von 13px für bessere Lesbarkeit */
    font-weight: 500;
    letter-spacing: 3%;
    line-height: 20px; /* Angepasst */
    color: #1C1D20;
}

.body1 {
    font-size: 16px; /* Browser-Standardgröße, erhöht von 11px */
    font-weight: 400;
    letter-spacing: -3%;
    line-height: 22px; /* Angepasst für Lesbarkeit */
    color: #1C1D20;
}

.body2 {
    font-size: 14px; /* Erhöht von 9px für bessere Lesbarkeit */
    font-weight: 400;
    letter-spacing: 0%;
    line-height: 20px; /* Angepasst */
    color: #1C1D20;
}

/* Links */
a {
    color: #0865FF; /* Royal Blue */
    text-decoration: none;
}

a:hover {
    color: #0153CC; /* Dunkelblau */
    text-decoration: underline;
}

/* Messages */
.messages {
    margin-top: 0;
    padding: 10px 20px;
}

.message {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 16px; /* Erhöht von 11px für Browser-Standard */
    line-height: 22px;
}

.message.error {
    background-color: #D32F2F; /* Red */
    color: #FFFFFF; /* White */
}

.message.success {
    background-color: #2E7D32; /* Green */
    color: #FFFFFF;
}

.message.warning {
    background-color: #FBC02D; /* Yellow */
    color: #1C1D20;
}

.message.info {
    background-color: #DEEAFF; /* Very Pale Blue */
    color: #1C1D20;
}

/* Content */
.content {
    padding-top: 4.5rem; /*FG20.7.25 4.0 statt 4.5 Increased to ensure enough space below navbar */
    padding-bottom: 0.25rem; /*FG20.7.25 0.25rem statt 20px*/
    padding-left: 0.25rem; /*FG20.7.25 0.25rem statt 20px*/
    padding-right: 0.25rem; /*FG20.7.25 0.25rem statt 20px*/
}

/* Reduziere das Padding der container-Klasse */
.container {
  padding-left: 0.25rem !important; /*FG20.7.25 0.25rem statt 20px*/
  padding-right: 0.25rem !important; /*FG20.7.25 0.25rem statt 20px*/
}

.container.mt-4 {
    padding: 0.25rem; /*FG20.7.25 0.25rem statt 20px*/
}

/* Table Styles */
.table {
    background-color: #F9F8F5; /* Off-White */
    color: #1C1D20; /* Off-Black */
    border-color: #E8E3D9; /* Neutral Beige/Taupe */
    font-size: 16px; /* Browser-Standardgröße für Konsistenz */
}

.table th {
    color: #0865FF; /* Royal Blue */
    background-color: #ECEBE6; /*Helleres Grau als Rahmenlinien*/
    /*background-color: #E8E3D9; /*Neutral Beige/Taupe*/
    /*background-color: #DEEAFF; Leicht hellblau, Very Pale Blue FG20.7.25 auskommentiert zugunsten Beige*/
    font-size: 18px; /* Entspricht .subtitle */
}

.table td {
    font-size: 16px; /* Entspricht .body1 */
}

.table.table-bordered.table-hover.table-striped.table-sm th {
    color: #0865FF; /* Royal Blue */
    background-color: #ECEBE6; /*Helleres Grau als Rahmenlinien*/
    /*background-color: #DEEAFF; /* Leicht hellblau, Very Pale Blue FG20.7.25 auskommentiert zugunsten Beige*/
    font-size: 18px; /* Entspricht .subtitle */
    white-space: nowrap; /* Verhindert Zeilenumbruch */
}

.table-hover tbody tr:hover {
    background-color: #DEEAFF; /* Very Pale Blue */
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #F5F3EE; /* Leicht dunkleres Off-White */
}

.table th,
.table td {
    padding: 12px; /* Beibehalten für Lesbarkeit */
}

/* Responsive Table */
@media (max-width: 576px) {
    .table-responsive,
    .table {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-radius: 0 !important;
    }

    .table-responsive {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-radius: 0 !important;
    }

    .card,
    .card-body {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Links Table */
.links-table {
    width: 80%;
    margin: 20px auto;
}

.links-table td {
    padding: 10px;
    vertical-align: top;
}


@media (max-width: 575.98px) {
  /* Prevent horizontal scrolling on very small screens */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .card-body {
    padding: 0;
  }
  
  /* Proper responsive container approach */
  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  /* Use minimal gutters instead of removing them entirely */
  .row {
    --bs-gutter-x: 0.5rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-right: 0;
  }
  
  .col-md-12, .col-sm-12, .col-12 {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  
  /* Cards get minimal margins for breathing room */
  .card {
    margin-bottom: 0.5rem;
  }
  
  /* Move all labels 10px to the right on report creation page for small screens */
  label {
    margin-left: 10px !important;
  }
  
  /* Prevent any element from causing horizontal overflow */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /*FG12.10.25 Ensure tables are responsive: allow horizontal scroll instead of squashing columns */
  /*Wichtig: Alle Tabellen-Templates brauchen den Wrapper <div class="table-responsive"> ... </div> */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-responsive > table {
    width: 100% !important;
    table-layout: auto; /* avoid fixed layout that squashes columns */
    white-space: nowrap; /* prevent wrapping so horizontal scroll appears */
  }
  .table-responsive td,
  .table-responsive th {
    white-space: nowrap;
  }
  
  /* Prevent form elements from overflowing */
  input, select, textarea {
    max-width: 100% !important;
  }
}

/* Fix for fieldset row overflow issue */
fieldset {
  overflow: hidden; /* Prevent content from extending beyond fieldset */
}

/* Ensure rows within fieldsets don't overflow due to negative margins */
fieldset .row,
fieldset .form-row {
  margin-left: 0;
  margin-right: 0;
}

/* Adjust column padding to compensate for removed row margins */
fieldset .row > [class*="col-"],
fieldset .form-row > [class*="col-"] {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* Add left padding to legend elements for better alignment */
legend {
  padding-left: 10px;
}

/* From clients/_form_common */
.section-label {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    margin-bottom: 1.5rem;
}

.form-control {
    padding: 0.5rem;
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.autocomplete-results {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.autocomplete-item:hover {
    background-color: #f5f5f5;
}
.autocomplete-item.selected {
    background-color: #e3f2fd;
}

.datetime-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
@media (min-width: 900px) {
    .datetime-row {
        flex-direction: row;
        gap: 1.5rem;
        align-items: end;
    }
    .datetime-row > div {
        flex: 1 1 0;
    }
}

/* Verhindert, dass die Tabelle die gesamte Container-Breite ausfüllt */
.compact-table {
    width: auto !important; /* Tabelle passt sich dem Inhalt an */
    max-width: 100%; /* Optional: Verhindert Überlauf auf kleinen Bildschirmen */
}
.compact-table td {
    width: 1px; /* Erzwingt minimale Breite basierend auf Inhalt */
    white-space: nowrap; /* Verhindert Zeilenumbruch in beiden Spalten */
    padding: 0.25rem 0.5rem; /* Kleineres Padding für kompakte Zeilen */
    line-height: 22px; /* Entspricht .body1 in style.css */
} 

/*FG25.7.25 Field Styles*/
.narrow-field {
    max-width: 100%;  /* Passt an die Col-Breite */
    width: auto;     /* Verhindert feste Breite */
}


/* Footer Disclaimer */
.footer {
    margin-top: auto;
    font-size: 14px;
    line-height: 1.6;
}

.footer a {
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Ensure content grows to push footer down */
.responsive-container.container.content {
    flex: 1 0 auto;
}

/* Footer stays at bottom */
.footer {
    flex-shrink: 0;
}
