/* =================================================================
   FUJIFILM WEB DESIGN SYSTEM - CUSTOM STYLESHEET V1.0
   =================================================================
   This stylesheet is the result of adapting the original
   custom_styles.css to the comprehensive style guide.
   It combines a systematic design approach with specific styles
   for existing applications.
   ================================================================= */

/* -----------------------------------------------------------------
   0. ROOT & CORE VARIABLES
   Defines the entire design system's foundation: colors,
   typography, and spacing.
   ----------------------------------------------------------------- */
   :root {
    /* Color Palette */
    --fujifilm-advanced-green: #01916D;
    --fujifilm-innovative-grey: #333333;
    --fujifilm-innovative-grey-rgb: 51, 51, 51;
    --fujifilm-innovative-grey-80: #5C5C5C;
    --fujifilm-innovative-grey-60: #858585;
    --fujifilm-innovative-grey-40: #ADADAD;
    --fujifilm-innovative-grey-20: #D6D6D6;
    --fujifilm-innovative-grey-10: #EBEBEB;
    --fujifilm-white: #FFFFFF;
    --fujifilm-communication-red: #FB0020;
    --fujifilm-communication-red-rgb: 251, 0, 32;
    --fujifilm-communication-orange: #EA5504;
    --fujifilm-communication-orange-rgb: 234, 85, 4;
    --fujifilm-text-light: var(--fujifilm-white);

    /* Semantic Colors (based on Bootstrap naming for compatibility) */
    --bs-primary: var(--fujifilm-advanced-green);
    --bs-primary-rgb: 1, 145, 109;
    --bs-primary-darken: color-mix(in srgb, var(--fujifilm-advanced-green) 85%, black);
    --bs-secondary: var(--fujifilm-innovative-grey-80);
    --bs-secondary-darken: color-mix(in srgb, var(--fujifilm-innovative-grey-80) 85%, black);
    --bs-body-color: var(--fujifilm-innovative-grey);
    --bs-body-color-rgb: var(--fujifilm-innovative-grey-rgb);
    --bs-body-bg: var(--fujifilm-innovative-grey-10);
    --bs-border-color: var(--fujifilm-innovative-grey-20);
    --bs-border-color-translucent: rgba(var(--fujifilm-innovative-grey-rgb), 0.15);
    --fujifilm-text-dark: var(--fujifilm-innovative-grey);
    --fujifilm-text-muted-dark: var(--fujifilm-innovative-grey-80);

    /* Typography */
    --bs-font-size-base: 0.9rem;
    --bs-font-size-sm: 0.8rem;
    --form-label-font-size: 0.85rem;

    /* Spacing Scale */
    --space-xs:  0.25rem; /* 4px */
    --space-s:   0.5rem;  /* 8px */
    --space-m:   1rem;    /* 16px */
    --space-l:   1.5rem;  /* 24px */
    --space-xl:  2.5rem;  /* 40px */
    --space-xxl: 4rem;    /* 64px */

    /* Frappe Gantt Overrides */
    --g-arrow-color: var(--fujifilm-innovative-grey-80);
    --g-bar-color: var(--fujifilm-white);
    --g-bar-border: var(--fujifilm-white);
    --g-tick-color-thick: var(--fujifilm-innovative-grey-20);
    --g-tick-color: var(--fujifilm-innovative-grey-10);
    --g-actions-background: var(--fujifilm-innovative-grey-10);
    --g-border-color: var(--fujifilm-innovative-grey-20);
    --g-text-muted: var(--fujifilm-text-muted-dark);
    --g-text-light: var(--fujifilm-white);
    --g-text-dark: var(--fujifilm-text-dark);
    --g-progress-color: var(--bs-primary);
    --g-handle-color: var(--fujifilm-text-dark);
    --g-weekend-label-color: var(--fujifilm-innovative-grey-10);
    --g-expected-progress: color-mix(in srgb, var(--bs-primary) 30%, var(--fujifilm-white));
    --g-header-background: var(--fujifilm-white);
    --g-row-color: var(--fujifilm-white);
    --g-row-border-color: var(--bs-border-color);
    --g-today-highlight: var(--fujifilm-advanced-green);
    --g-popup-actions: var(--fujifilm-innovative-grey-10);

    /* Click Cost table colors */
    --clickcost-category-details: #88ABCD; /* Details columns */
    --clickcost-category-costs: #8E38BE;    /* Cost columns */
    --clickcost-category-cpc: #ED356C;      /* CPC columns */
}

/* -----------------------------------------------------------------
   1. BASE & TYPOGRAPHY
   Global styles for basic HTML elements.
   ----------------------------------------------------------------- */
body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: 'Roboto', sans-serif;
    font-size: var(--bs-font-size-base);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    overflow-x: hidden; /* verhindert horizontale Scrollbalken bei Select2-Dropdowns */
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    font-weight: 500;
    color: var(--fujifilm-text-dark);
    margin-top: 0;
}

h1, .h1 { font-size: calc(var(--bs-font-size-base) * 2); }
h2, .h2 { font-size: calc(var(--bs-font-size-base) * 1.75); margin-top: var(--space-xl); margin-bottom: var(--space-m); }
h3, .h3 { font-size: calc(var(--bs-font-size-base) * 1.3); }
h4, .h4 { font-size: calc(var(--bs-font-size-base) * 1.2); }
h5, .h5 { font-size: calc(var(--bs-font-size-base) * 1.05); }

p {
    margin-top: 0;
    margin-bottom: var(--space-m);
}

a {
    color: var(--bs-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--bs-primary-darken);
}

.text-emphasis {
    color: var(--bs-primary);
    font-weight: 500;
}

/* -----------------------------------------------------------------
   2. LAYOUT & BRAND ELEMENTS
   ----------------------------------------------------------------- */
.main-content-wrapper {
    margin: 0 auto;
    padding: 0 calc(var(--space-m) / 2) var(--space-m);
}

.green-gradation-line {
    height: 4px;
    width: 100%;
    background: linear-gradient(to right, #00D164, #006449, #01916D, #00FF52, #96FFFD);
    position: absolute;
    bottom: 0;
    left: 0;
    margin: 0;
    z-index: 10;
}

/* -----------------------------------------------------------------
   3. GENERAL UI COMPONENTS
   ----------------------------------------------------------------- */

/* 3.1 Buttons */
.btn {
    display: inline-block;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.5rem 1.5rem;
    font-size: var(--bs-font-size-base);
    border-radius: 0.375rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.btn:disabled, .btn.disabled {
    opacity: 0.65;
    pointer-events: none;
}
.btn-primary {
    color: var(--fujifilm-white);
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.btn-primary:hover, .btn-primary:focus {
    color: var(--fujifilm-white);
    background-color: var(--bs-primary-darken);
    border-color: var(--bs-primary-darken);
}
.btn-secondary {
    color: var(--fujifilm-white);
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}
.btn-secondary:hover,
.btn-secondary:focus {
    color: var(--fujifilm-white);
    background-color: var(--bs-secondary-darken);
    border-color: var(--bs-secondary-darken);
}
.btn-outline-secondary {
    color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    color: var(--fujifilm-white);
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}
.btn-link {
    font-weight: 400;
    color: var(--bs-primary);
    text-decoration: none;
}
.btn-link:hover, .btn-link:focus {
    text-decoration: underline;
}

/* 3.2 Cards */
.card {
    background-color: var(--fujifilm-white);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(var(--fujifilm-innovative-grey-rgb), 0.08);
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
    margin-bottom: var(--space-l);
}
.card:hover {
    box-shadow: 0 6px 20px rgba(var(--fujifilm-innovative-grey-rgb), 0.12);
    transform: translateY(-2px);
}
.card-header {
    background-color: var(--fujifilm-innovative-grey-10);
    padding: var(--space-m) var(--space-l);
    border-bottom: 1px solid var(--bs-border-color);
}
.card-body {
    padding: var(--space-l);
}
.card-title {
    color: var(--bs-primary);
    font-size: calc(var(--bs-font-size-base) * 1.05); /* Entspricht h5 */
    font-weight: 500;
    margin-bottom: var(--space-s);
}
.card-text:last-child {
    margin-bottom: 0;
}
.card-footer {
    background-color: transparent;
    padding: var(--space-m) var(--space-l);
    border-top: 1px solid var(--bs-border-color);
}

/* 3.3 Forms */
.form-label {
    font-size: var(--form-label-font-size);
    font-weight: 500;
    color: var(--fujifilm-text-muted-dark);
    margin-bottom: var(--space-s);
}
.form-control, .form-select {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: var(--bs-font-size-base);
    font-weight: 400;
    line-height: 1.5;
    color: var(--fujifilm-text-dark);
    background-color: var(--fujifilm-white);
    background-clip: padding-box;
    border: 1px solid var(--fujifilm-innovative-grey-40);
    border-radius: 0.375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.form-control:focus, .form-select:focus {
    color: var(--fujifilm-text-dark);
    background-color: var(--fujifilm-white);
    border-color: var(--bs-primary);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}
.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--fujifilm-communication-red);
}
.form-control.is-invalid:focus, .form-select.is-invalid:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--fujifilm-communication-red-rgb), 0.25);
}
.form-control.is-valid, .form-select.is-valid {
    border-color: var(--fujifilm-advanced-green);
}
.form-control.is-valid:focus, .form-select.is-valid:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* 3.4 Alerts */
.alert {
    position: relative;
    padding: var(--space-m);
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}
.alert-success {
    background-color: color-mix(in srgb, var(--bs-primary) 10%, var(--fujifilm-white));
    border-color: color-mix(in srgb, var(--bs-primary) 25%, var(--fujifilm-white));
    color: color-mix(in srgb, var(--bs-primary) 85%, black);
}
.alert-danger {
    background-color: color-mix(in srgb, var(--fujifilm-communication-red) 10%, var(--fujifilm-white));
    border-color: color-mix(in srgb, var(--fujifilm-communication-red) 25%, var(--fujifilm-white));
    color: color-mix(in srgb, var(--fujifilm-communication-red) 85%, black);
}
.alert-warning {
    background-color: color-mix(in srgb, var(--fujifilm-communication-orange) 15%, var(--fujifilm-white));
    border-color: color-mix(in srgb, var(--fujifilm-communication-orange) 30%, var(--fujifilm-white));
    color: color-mix(in srgb, var(--fujifilm-communication-orange) 85%, black);
}
.alert-info {
    background-color: var(--fujifilm-innovative-grey-10);
    border-color: var(--bs-border-color);
    color: var(--fujifilm-text-muted-dark);
}

/* 3.5 Icons */
.icon {
    display: inline-block;
    color: var(--fujifilm-innovative-grey-60);
    font-size: 1.2em;
    line-height: 1;
    vertical-align: -0.15em;
}
.icon.icon-accent {
    color: var(--bs-primary);
}
.icon.icon-duotone {
    --fa-primary-color: var(--bs-primary);
    --fa-secondary-color: var(--fujifilm-innovative-grey-60);
    --fa-primary-opacity: 1;
    --fa-secondary-opacity: 1;
}
.alert .icon {
    margin-right: var(--space-s);
}

/* Icons in Buttons sollen die Textfarbe erben */
.btn .icon {
    color: inherit;
}

/* 3.6 Header */
.main-header {
    background-color: var(--fujifilm-white);
    padding: 0 var(--space-l);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: none;
    margin-bottom: 0;
}
.header-logo {
    height: 40px;
}

.main-header .nav-link {
    color: var(--fujifilm-text-dark);
    font-weight: 500;
    font-size: var(--bs-font-size-base);
    padding: 1rem;
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.main-header .nav-link:hover {
    color: var(--bs-primary);
}

.main-header .nav-link.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
}

/* Tab navigation styling */
.nav-tabs .nav-link {
    color: var(--fujifilm-text-dark);
    background-color: var(--fujifilm-white);
    border: 1px solid var(--fujifilm-innovative-grey-20);
    margin-right: .25rem;
}
.nav-tabs .nav-link.active {
    color: var(--fujifilm-white);
    background-color: var(--fujifilm-advanced-green);
    border-color: var(--fujifilm-advanced-green);
}


/* -----------------------------------------------------------------
   4. ADVANCED COMPONENTS
   ----------------------------------------------------------------- */

/* 4.1 Select2 Library Customization */
.select2-container {
    width: 100% !important;
    font-size: var(--bs-font-size-base) !important;
}
.select2-container--bootstrap-5 .select2-selection--single {
    border: 1px solid var(--fujifilm-innovative-grey-40) !important;
    height: calc(1.5em + .75rem + 2px) !important;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    background-color: var(--fujifilm-white) !important;
    border-radius: .375rem !important;
    display: flex;
    align-items: center;
    padding: 0 !important;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection--single,
.select2-container--bootstrap-5.select2-container--open .select2-selection--single {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--fujifilm-text-dark) !important;
    line-height: normal;
    padding-left: .75rem !important;
    padding-right: 2.5rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: var(--fujifilm-innovative-grey-60);
}
.select2-container--bootstrap-5 .select2-dropdown {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    border-radius: .375rem;
}
.select2-container--bootstrap-5 .select2-results > .select2-results__options {
    max-height: 40vh;
    overflow-y: auto;
}
.select2-container--bootstrap-5 .select2-results__option {
    padding: var(--space-s) var(--space-m);
    color: var(--fujifilm-text-dark);
}
.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--bs-primary) !important;
    color: var(--fujifilm-white) !important;
}

/* -----------------------------------------------------------------
   5. APP-SPECIFIC & LEGACY STYLES
   Styles from the original CSS for specific use cases like
   backend-apps with a sidebar navigation.
   ----------------------------------------------------------------- */

/* 5.1 Sidebar Layout */
.sidebar {
    width: 220px;
    background-color: var(--fujifilm-innovative-grey);
    padding-top: var(--space-m);
    box-shadow: 0.125rem 0 0.25rem rgba(0,0,0,.1);
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
}
.sidebar .sidebar-brand-text {
    color: var(--fujifilm-text-light);
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    display: block;
}
.sidebar .sidebar-brand {
    text-align: center;
}

/* Section titles within the sidebar */
.sidebar .menu-section-title {
    color: var(--fujifilm-text-light);
    font-size: var(--bs-font-size-sm);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    text-transform: uppercase;
}
.sidebar .nav-link {
    color: var(--fujifilm-innovative-grey-20);
    padding: 0.65rem 1.25rem;
    font-size: var(--bs-font-size-base);
    border-left: 4px solid transparent;
    transition: background-color 0.15s ease-in-out,
                color 0.15s ease-in-out,
                border-left-color 0.15s ease-in-out;
}
.sidebar .nav-link:hover {
    color: var(--fujifilm-white);
    background-color: var(--fujifilm-innovative-grey-80);
    border-left-color: var(--bs-primary);
}
.sidebar .nav-link.active {
    color: var(--fujifilm-white);
    font-weight: 500;
    background-color: var(--bs-primary);
    border-left-color: var(--fujifilm-communication-red);
}
.sidebar .nav-link .fas {
    margin-right: var(--space-s);
    width: 20px;
    text-align: center;
}
@media (min-width: 768px) {
    .sidebar {
        transition: width 0.3s ease;
    }
    .main-content {
        margin-left: 220px;
        width: calc(100% - 220px);
        transition: margin-left 0.3s ease, width 0.3s ease;
    }
    .sidebar-collapsed .sidebar {
        width: 60px;
    }
    .sidebar-collapsed .main-content {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
    .sidebar-collapsed .sidebar-text,
    .sidebar-collapsed .menu-section-title {
        display: none;
    }
    .sidebar-collapsed .nav-link .fas {
        margin-right: 0;
    }
    /* Hover-basiertes Ausklappen entfernt, damit nur der explizite Button den Zustand ändert */
    /*
    .sidebar-collapsed .sidebar:hover {
        width: 220px;
    }
    .sidebar-collapsed .sidebar:hover .sidebar-text,
    .sidebar-collapsed .sidebar:hover .menu-section-title {
        display: inline-block;
    }
    .sidebar-collapsed .sidebar:hover .nav-link .fas {
        margin-right: var(--space-s);
    }
    */
}
.main-content {
    flex-grow: 1;
    padding: 0 calc(var(--space-l) / 2) var(--space-l);
    overflow-y: auto;
}
.page-header-custom {
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: var(--space-m);
    margin-bottom: var(--space-l);
}
.page-header-custom .h2 {
    color: var(--fujifilm-text-dark);
    font-weight: 500;
    margin-top: var(--space-l);
}

/* 5.2 Specific Card Variants */
.part-family-card {
    background-color: var(--fujifilm-white);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(var(--fujifilm-innovative-grey-rgb), 0.08);
    padding: var(--space-m);
    margin-bottom: var(--space-l);
}
.part-name-heading {
    font-size: 1.1em;
    color: var(--bs-body-color);
    margin-top: 0;
    margin-bottom: var(--space-s);
    font-weight: 600;
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: var(--space-s);
}
/* Verbrauchsmaterial-Balken im Gerätedetail */
.consumable-bar {
    width: 40px;
    height: 160px;
    position: relative;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}

/* Jeder Eintrag (K1, C, M, …) bekommt ein flexibles Container-Element */
.consumable-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Breite definiert, damit alle Balken gleich weit voneinander entfernt sind */
    width: 80px;
    margin: 0 8px;
  }


/* Der Balken-Container selbst */
.consumable-bar {
  /* Höhe des Balkens insgesamt (daran rechnet sich die Prozent-Höhe) */
  height: 100px;
  /* Breite des Balkens */
  width: 40px;

  background-color: #e9ecef;  /* Helles Grau als Hintergrund, damit leere Anteile sichtbar sind */
  border: 1px solid #ccc;     /* Dezenter Rahmen */
  border-radius: 6px;         /* Abgerundete Ecken */

  position: relative;         /* für .fill und .percentage-label */
  overflow: hidden;           /* Verhindert, dass die Füllung über den Balken hinausragt */

  /* Moderner Schatten, damit der Balken „aufgehoben“ wirkt */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Label mit der Prozentzahl */
.consumable-bar .percentage-label {
    position: absolute;
    top: 50%;                    /* vertikale Mitte des Balkens */
    left: 50%;                   /* horizontale Mitte des Balkens */
    transform: translate(-50%, -50%); /* verschiebt die Box exakt in die Mitte */

    font-size: 0.75rem;
    font-weight: bold;
    color: #000;

    background-color: rgba(255, 255, 255, 0.85); /* halbtransparenter Hintergrund, damit alle Zahlen gut lesbar sind */
    padding: 2px 4px;
    border-radius: 2px;
    white-space: nowrap; /* verhindert Zeilenumbruch in der Zahl */
  }

  /* Optional: Wenn du bestimmte Farben etwas abmildern möchtest,
     kannst du hier weitere Selektoren hinzufügen, z.B. für schwarze Füllung */
  /* Beispiel: (muss nur dann hin, wenn du nicht mehr mit inline background-color arbeiten willst)
     .consumable-bar .fill.k-black { background-color: #000; }
     .consumable-bar .fill.k-cyan  { background-color: #00AEEF; }
     usw.
     Da eure Vorlage die Farbe ja direkt per inline style setzt, ist das aber eigentlich nicht nötig.
  */



  /* Die Füllung innerhalb des Balkens */
.consumable-bar .fill {
    width: 100%;                /* Füllt immer die gesamte Breite des Containers */

    /* Höhe wird weiterhin über inline style="height: 60%;" o. Ä. gesteuert */
    position: absolute;         /* Damit die Füllung immer „unten“ beginnt */
    bottom: 0;
    left: 0;

    /* Runde obere Ecken, sobald der Balken gefüllt ist */
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
  }

/* CUSTOM ADDITIONS / OVERRIDES FOR CALL DETAILS PAGE */

/* Style for active call item in the list */
.list-group-item.call-item.active {
    background-color: var(--bs-primary); /* Fujifilm Advanced Green */
    border-color: var(--bs-primary);
    color: var(--fujifilm-white); /* White text for contrast */
}

/* Ensure all text and icons within active item are white */
.list-group-item.call-item.active *,
.list-group-item.call-item.active .icon {
    color: var(--fujifilm-white) !important; /* Override to ensure all text and icons are white */
}

/* Subtle hover effect for call list items */
.list-group-item.call-item:not(.active):hover {
    background-color: var(--fujifilm-innovative-grey-10); /* Light grey hover */
    cursor: pointer;
}


/* Style for the detail card sections */
.detail-section {
    margin-bottom: var(--space-m);
    padding-bottom: var(--space-s);
    border-bottom: 1px dashed var(--fujifilm-innovative-grey-20);
}

.detail-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-section-title {
    font-size: var(--bs-font-size-base);
    font-weight: 500;
    color: var(--fujifilm-text-muted-dark);
    margin-bottom: var(--space-s);
}

.detail-item {
    display: flex; /* Use flexbox for label and value alignment */
    align-items: baseline; /* Align text baselines */
    margin-bottom: var(--space-xs); /* Tighter spacing for individual items */
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item-label {
    font-weight: 500;
    color: var(--fujifilm-text-dark);
    flex-shrink: 0; /* Prevent label from shrinking */
    padding-right: var(--space-s); /* Space between label and value */
    white-space: nowrap; /* Prevent label from wrapping */
}

.detail-item-value {
    color: var(--fujifilm-text-dark);
    flex-grow: 1; /* Allow value to take up remaining space */
    word-break: break-word; /* Allow long words to break */
}

/* Specific styling for long text fields like repair report */
.detail-item-value.long-text {
    text-align: left; /* Align left for readability of long texts */
    word-wrap: break-word; /* Allow long words to break and wrap */
    white-space: pre-wrap; /* Preserve whitespace and wrap text */
}

/* Highlight important information in detail card */
.detail-item-value.highlight-green {
    font-weight: 500; /* Medium weight for values */
    color: var(--bs-primary); /* Green accent for numeric values */
}

/* Style for copy button */
.copy-btn {
    background: none;
    border: none;
    color: var(--fujifilm-innovative-grey-60);
    padding: 0;
    margin-left: var(--space-xs);
    cursor: pointer;
    font-size: 0.8em; /* Smaller icon */
    transition: color 0.2s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.copy-btn:hover {
    color: var(--bs-primary);
}


@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 220px; /* Behält die definierte Breite bei */
        height: 100%;
        z-index: 1040;
        transform: translateX(-100%); /* Startet außerhalb des Bildschirms */
        transition: transform 0.3s ease-in-out;
        /* NEU: Sidebar standardmäßig ausblenden (nimmt keinen Platz im Layout ein) */
        display: none;
    }
    .sidebar.active {
        transform: translateX(0); /* Slide-in-animation */
        /* NEU: Sidebar sichtbar machen, wenn die Klasse 'active' gesetzt ist */
        display: flex; /* Passt zu d-flex flex-column im HTML */
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1030;
    }
    .sidebar-backdrop.active {
        display: block;
    }
    .main-content {
        padding: 0 var(--space-s) var(--space-m);
        margin-left: 0;
        width: 100%;
    }
    #sidebarToggle {
        position: static;
        margin-right: var(--space-s);
    }
}


/* Tabellen mit kritischen Werten fett darstellen */
td.text-danger {
    font-weight: bold;
}

/* Zeilenumbruch in den Namensspalten der HFSI- und Replacements-Tabellen zulassen */
#hfsiTable td:nth-child(2),
#replTable td:nth-child(2) {
    white-space: normal;
    word-break: break-word;
}

@media (max-width: 576px) {
    #hfsiTable th:nth-child(1),
    #hfsiTable td:nth-child(1),
    #hfsiTable th:nth-child(3),
    #hfsiTable td:nth-child(3),
    #hfsiTable th:nth-child(4),
    #hfsiTable td:nth-child(4) {
        display: none;
    }
}

/* Frappe Gantt Customizations */
.gantt-wrapper {
    font-size: var(--bs-font-size-sm);
    position: relative; /* Ensure this is relative for absolute positioning of overlay buttons */
}

#ganttChart.gantt-container {
    height: auto;
    overflow: visible;
}

.gantt .bar-label {
    font-family: 'Roboto', sans-serif;
    font-size: var(--bs-font-size-sm);
}

.gantt .upper-text {
    font-size: var(--bs-font-size-base);
}

.gantt .lower-text {
    font-size: var(--bs-font-size-sm);
}

.gantt-container .popup-wrapper .title {
    font-weight: 500;
}

/* Overlay Navigation Buttons for Gantt Chart */
.gantt-navigation-overlay {
    position: absolute;
    top: 50%; /* Center vertically */
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none; /* Allows clicks to pass through to the gantt chart unless on button */
    z-index: 100; /* Ensure buttons are above the chart */
    padding: 0 var(--space-s); /* Add some padding from the edges */
}

.gantt-navigation-overlay .nav-btn {
    background-color: rgba(var(--fujifilm-innovative-grey-rgb), 0.7); /* Semi-transparent grey */
    border: none;
    color: var(--fujifilm-white);
    font-size: 2rem;
    padding: var(--space-s);
    cursor: pointer;
    border-radius: var(--space-s);
    transition: background-color 0.2s ease, color 0.2s ease;
    pointer-events: auto; /* Re-enable pointer events for the buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; /* Fixed width for consistent button size */
    height: 40px; /* Fixed height for consistent button size */
}

.gantt-navigation-overlay .nav-btn:hover {
    background-color: var(--bs-primary); /* Fujifilm Advanced Green on hover */
}

/* Ensure two-line table headers remain visible when scrolling */
.dataTables_scrollHead, .dataTables_scrollHead table {
    height: auto !important;
}

/* Sticky table headers */
.table-sticky {
    position: relative;
    max-height: 70vh;
    overflow-y: auto;
}
.table-sticky thead th {
    position: sticky;
    top: 0;
    background-color: var(--bs-body-bg);
    z-index: 1;
}

/* -----------------------------------------------------------------
   Click Cost table category colors
   category-details: columns with customer and device info
   category-costs: columns with click and cost values
   category-cpc: columns with cost-per-click values
   ----------------------------------------------------------------- */
#clickcostTable th.category-details,
#clickcostTable td.category-details,
.fixedHeader-floating th.category-details {
    background-color: color-mix(in srgb, var(--clickcost-category-details) 20%, var(--fujifilm-white)) !important;
}
#clickcostTable th.category-costs,
#clickcostTable td.category-costs,
.fixedHeader-floating th.category-costs {
    background-color: color-mix(in srgb, var(--clickcost-category-costs) 20%, var(--fujifilm-white)) !important;
}
#clickcostTable th.category-cpc,
#clickcostTable td.category-cpc,
.fixedHeader-floating th.category-cpc {
    background-color: color-mix(in srgb, var(--clickcost-category-cpc) 20%, var(--fujifilm-white)) !important;
}

/* Stellt sicher, dass der von DataTables generierte Wrapper
   sich korrekt in das Seitenlayout einfügt. */
.dataTables_wrapper {
    width: 100%;
}

/* Loading overlay shown during Suchanfragen */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay .printer-icon {
    font-size: 3rem;
    color: var(--bs-primary);
    position: relative;
    animation: print-bounce 1s infinite;
}

@keyframes print-bounce {
    0%, 100% { transform: translateY(-10%); }
    50% { transform: translateY(0); }
}

/* ---------------------------------------------------------------
   Login Page Styles
   Implements a minimal glassmorphism design for the login screen
   --------------------------------------------------------------- */

body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--fujifilm-advanced-green), var(--fujifilm-innovative-grey-10));
}

.login-glass {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--space-m);
    padding: var(--space-xl);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

