:root {
    --primary-color: #255879;
    --primary-hover: rgba(40, 167, 69, 0.1);
    --font-main: 'Poppins', sans-serif;
    --page-bg: #f2f2f7;
    --tile-bg: #ffffff;
    --tile-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 20px rgba(0,0,0,0.06);
    --tile-shadow-hover: 0 2px 8px rgba(0,0,0,0.07), 0 8px 32px rgba(0,0,0,0.09);
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --separator: rgba(0,0,0,0.08);
}

/* Initial Loading Styles */
body.is-loading .profile-container {
    opacity: 0;
    pointer-events: none;
}

.profile-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--page-bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

body:not(.is-loading) .profile-loading-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.profile-loading-spinner {
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animationen für Benachrichtigungen */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

img, svg {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
}

img, svg {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

* {
    cursor: default;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--page-bg);
    height: calc(var(--vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

button, a, .menu-toggle, .user-profile, .dropdown-item, .menu-dropdown-item, 
.login-button, .add-entry-header-btn, .profile-name,
.profile-avatar, .menu-toggle svg, h1[onclick],
.header-logo, .header-logo img, .social-icon, .social-icon svg,
.profile-settings-btn, .logo-edit-btn, .abo-info {
    cursor: pointer !important;
}

/* Header Styles */
header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: calc(var(--vh, 1vh) * 8);
    background-color: var(--primary-color);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: white;
    padding: 0 2vw;
    margin: 0;
    border-bottom: 0.1vh solid rgba(204, 204, 204, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
}

.header-left {
    justify-self: start;
}

.header-right {
    justify-self: end;
    position: relative;
}

.menu-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    opacity: 0.8;
}

.menu-toggle svg {
    width: 3vw;
    height: 3vw;
    max-width: 32px;
    max-height: 32px;
}

.menu-dropdown {
    position: fixed;
    top: calc(var(--vh, 1vh) * 8);
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    display: none;
    padding: 4vh 0;
}

.menu-dropdown.show {
    display: flex;
    justify-content: center;
}

@media (min-width: 769px) {
    .header-left:hover .menu-dropdown {
        display: flex !important;
        justify-content: center !important;
    }

    .tile-allgemeine-infos {
        height: 470px;
    }
}

.menu-dropdown-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 11vw;
    padding: 0 2vw;
    position: relative;
}

.menu-dropdown-column {
    padding: 0;
}

.menu-dropdown-column-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 18px;
    padding: 1.5vh 0 1vh 0;
    margin-bottom: 0.5vh;
}

.menu-dropdown-item {
    padding: 0.8vh 0;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 16px;
    transition: color 0.2s ease;
    color: #555;
    display: block;
    line-height: 1.4;
    font-weight: 500;
    font-family: var(--font-main);
}

.menu-dropdown-item:hover {
    color: var(--primary-color);
}

.menu-dropdown-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.menu-dropdown-footer {
    position: absolute;
    bottom: 2vh;
    right: 2vw;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.8vh;
}

.menu-dropdown-social {
    display: flex;
    gap: 15px;
}

.menu-dropdown-social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #255879 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.menu-dropdown-social-icon:hover {
    background-color: #1e4a5f !important;
    transform: scale(1.1);
}

.menu-dropdown-social-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.menu-dropdown-separator {
    display: none;
}

.menu-dropdown-legal {
    display: contents;
}

.login-button {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    white-space: nowrap;
    width: 90px;
    text-align: center;
}

.login-button:hover {
    background-color: rgba(37, 88, 121, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 18px 6px 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.18s ease;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.8) inset,
        0 2px 8px rgba(0, 0, 0, 0.10),
        0 0.5px 2px rgba(0, 0, 0, 0.08);
    position: relative;
}

.user-profile:hover {
    background: linear-gradient(180deg, #f5f5f7 0%, #ebebed 100%);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.7) inset,
        0 3px 10px rgba(0, 0, 0, 0.13),
        0 0.5px 2px rgba(0, 0, 0, 0.1);
    transform: none;
}

.user-profile:active {
    background: linear-gradient(180deg, #e8e8ea 0%, #dfdfe1 100%);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.5) inset,
        0 1px 4px rgba(0, 0, 0, 0.1);
    transform: scale(0.98);
}

.profile-avatar {
    width: clamp(24px, 3vw, 32px);
    height: clamp(24px, 3vw, 32px);
    border-radius: 50%;
    background-color: #255879;
    border: 2px solid #255879;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: clamp(10px, 1vw, 14px);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
}

.profile-avatar.has-image {
    background: white;
    font-size: 0;
    border: 2px solid var(--primary-color);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 50%;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.profile-avatar.wide-image img {
    max-width: 90%;
    max-height: 60%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
}

.profile-name {
    color: #255879 !important;
    font-size: clamp(12px, 0.85vw, 15px);
    font-weight: 600;
    letter-spacing: -0.01em;
    max-width: clamp(80px, 160px, 100%);
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 0.1vh solid rgba(221, 221, 221, 0.5);
    border-radius: 1vh;
    box-shadow: 0 0.5vh 1.5vh rgba(0, 0, 0, 0.15);
    min-width: 15vw;
    z-index: 1000;
    display: none;
    margin-top: 10px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 1.5vh 2vw;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    color: #888888;
    font-family: var(--font-main);
    font-weight: 400;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(248, 249, 250, 0.8);
}

.dropdown-item:first-child {
    border-radius: 1vh 1vh 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 1vh 1vh;
    color: #dc3545;
}

h1 {
    font-size: 2.5vw;
    font-weight: 700;
    color: var(--primary-color);
}

main {
    flex: 1;
    background-color: var(--page-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1vh 2vw;
    margin-top: calc(var(--vh, 1vh) * 8);
    height: calc(var(--vh, 1vh) * 92);
    overflow: hidden;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.1vw;
    text-decoration: none;
    color: white !important;
    font-size: 2.5vw;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.header-logo img {
    height: 5vh;
    width: auto;
    image-rendering: smooth;
    filter: brightness(0) invert(1);
}

.header-logo-container {
    justify-self: center;
}

/* Profile Container & Tiles */
.profile-container {
    display: grid;
    grid-template-columns: 70px 363px 363px 363px;
    grid-template-rows: auto auto auto;
    grid-auto-rows: auto;
    column-gap: 20px;
    row-gap: 20px;
    width: fit-content;
    max-width: none;
    padding: 0;
    min-height: 410px;
}

.profile-container .profile-sidebar {
    grid-column: 1;
    grid-row: 1 / -1;
}

.profile-container .tile-small-box {
    grid-column: 2;
}

.profile-container .flip-container {
    grid-column: 3 / 5;
}

.profile-container .tile-allgemeine-infos {
    grid-column: 2;
}

.profile-container .tile-karte {
    grid-column: 3;
}

.profile-container .tile-branchen {
    grid-column: 4;
}

.profile-container.limited-profile {
    grid-template-columns: 70px 363px;
    grid-template-rows: auto auto auto;
    max-width: 500px;
    margin: 0 auto;
}

.profile-container.limited-profile .tile-small-box {
    grid-column: 2;
    grid-row: 1;
}

.profile-container.limited-profile .flip-container {
    display: none !important;
}

.profile-container.limited-profile .tile-allgemeine-infos {
    grid-column: 2;
    grid-row: 2 / span 2;
    width: 363px;
    height: auto;
}

.profile-container.limited-profile .tile-karte {
    display: none !important;
}

.profile-container.limited-profile .tile-branchen {
    display: none !important;
}

.profile-container.limited-profile [data-section="forms"],
.profile-container.limited-profile [data-section="cert"] {
    display: none !important;
}

.tile {
    background-color: var(--tile-bg);
    border: none;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 205px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    box-shadow: var(--tile-shadow);
}

.profile-container .profile-sidebar.tile {
    min-height: auto;
}

.tile:hover {
    box-shadow: var(--tile-shadow-hover);
    transform: translateY(-2px);
}

/* Deaktiviere Tile Hover-Effekt wenn Gründungsjahr im Edit-Modus ist */
.tile-unternehmensdata:has(.editing-mode):hover {
    transform: none !important;
    box-shadow: 0 1px 3px rgba(37, 88, 121, 0.1) !important;
}

.tile h3 {
    font-size: 17px;
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
    position: absolute;
    top: 24px;
    left: 24px;
    letter-spacing: -0.2px;
}

/* Unternehmensdaten Grid Layout */
.tile-unternehmensdata {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 60px;
    position: relative;
}

.unternehmensdata-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 100px 30px;
    column-gap: 20px;
    row-gap: 0;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 130px;
    min-height: 130px;
    max-height: 130px;
    margin-top: -15px;
    align-items: stretch;
    overflow: visible;
}

.unternehmensdata-item {
    display: contents;
}

/* Verstecke leere Items - Target die inneren Container */
.founding-year-container.empty,
.company-size-container.empty,
.shipment-value-row1.empty,
.shipment-value-row2.empty,
.founding-year-label.empty,
.company-size-label-external.empty,
.shipment-label-external.empty {
    display: none !important;
}

/* Versand Kachel (3. Kachel) - im Grid */
#shipmentValue {
    grid-row: 1;
    grid-column: 3;
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    box-shadow: none;
    margin: 0 auto;
    font-size: 0;
}

/* 1. Zeile der 3. Spalte - Versand-Visualisierung mit LKW und Wellen */
.shipment-value-row1 {
    grid-row: 1;
    grid-column: 3;
    width: 100%;
    min-width: auto;
    max-width: none;
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    background-color: transparent !important;
    margin: 0 auto;
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    background-size: 43% !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
}

/* SVG für Versand-Visualisierung */
.shipment-value-row1 svg {
    width: 150%;
    height: 100%;
    display: block;
    margin: 0 -25%;
    overflow: visible !important;
}

/* 2. Zeile der 3. Spalte - Versand-Wert (identisch wie founding-year-value) */
.shipment-value-row2 {
    grid-row: 2;
    grid-column: 3;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    background-color: transparent;
    margin: 0 auto;
    overflow: hidden;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-align: center;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Im Edit-Mode: Höhe auf auto setzen, um Content vollständig anzuzeigen */
.shipment-value-row2.editing-mode {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    overflow: visible !important;
}

/* Wenn shipment-value-row2 im Edit-Mode ist, bleibt das Grid unverändert */
.unternehmensdata-grid:has(.shipment-value-row2.editing-mode) {
    /* Grid behält seine ursprüngliche Höhe bei */
    grid-template-rows: 100px 30px !important;
}

.unternehmensdata-label {
    font-size: 12px;
    font-weight: 600;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.unternehmensdata-value {
    font-size: 18px;
    font-weight: 700;
    color: #255879;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 60px;
}

/* Company Size Visualization (Circles/Heads) */
.company-size-visualization {
    max-width: 100%;
    max-height: 25px;
    height: auto;
    margin: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.company-bars-container {
    gap: 6px !important;
}

/* Founding Year Semicircle Chart Styles - Wrapper wird durch display: contents entfernt */

/* Im Edit-Modus: Gesamter Container einfrieren */
.founding-year-container.editing-mode {
    transform: none !important;
    pointer-events: auto !important;
}

.semicircle-chart {
    width: 100%;
    height: 100%;
}

.semicircle-segment {
    transition: all 0.3s ease;
    stroke: white;
    stroke-width: 1.5;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
}

.semicircle-segment:hover {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
    opacity: 0.9;
}

/* Hover-Effekt im Edit-Modus deaktivieren */
.semicircle-chart.editing-mode .semicircle-segment:hover {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    opacity: 1;
}

/* Im Edit-Modus: Halbkreis komplett einfrieren */
.semicircle-chart.editing-mode {
    pointer-events: none !important;
}

.semicircle-chart.editing-mode .semicircle-segment {
    transition: none !important;
    transform: none !important;
}

.semicircle-chart-wrapper.editing-mode {
    pointer-events: none !important;
}

.semicircle-chart-wrapper.editing-mode svg {
    transform: none !important;
}

.unternehmensdata-item.editing-mode .semicircle-chart-wrapper {
    pointer-events: none !important;
    transform: none !important;
}

.founding-year-input-wrapper .founding-year-input {
    color: #FDDA0D !important;
}

.founding-year-input-wrapper .founding-year-spinner-btn {
    color: #FDDA0D !important;
}

/* GRID POSITIONING */
.semicircle-chart-wrapper {
    grid-row: 1;
    grid-column: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0;
    overflow: hidden;
}

.founding-year-value {
    grid-row: 2;
    grid-column: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-align: center;
    margin: 0;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
    justify-content: center;
}

.company-size-wrapper {
    grid-row: 1;
    grid-column: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: hidden;
    margin: 0;
    padding-left: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.company-size-value {
    grid-row: 2;
    grid-column: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    overflow: hidden;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-align: center;
    margin: 0;
    padding: 0;
    width: 100%;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-size-wrapper.editing-mode {
    pointer-events: none;
}

/* Im Edit-Mode: Verstecke alles in companySizeValue AUSSER dem Input-Wrapper */
.company-size-value.editing-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0; /* Versteckt Textkoten */
    line-height: 1.4;
    margin-top: 0;
    height: auto;
}

.company-size-value.editing-mode > * {
    display: none !important;
}

.company-size-value.editing-mode > .company-size-input-wrapper {
    display: flex !important;
    font-size: 16px; /* Stellt die Schriftgröße für den Input wieder her */
}

/* Labels Container - gleiche Grid-Struktur wie das Gitter oben */
.unternehmensdata-labels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 20px;
    width: 100%;
    margin-top: 2px;
}

/* Founding Year & Company Size Labels - perfekt unter den Spalten ausgerichtet */
.founding-year-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    grid-column: 1;
    letter-spacing: 0.2px;
    text-align: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    position: relative;
    text-transform: uppercase;
}

.company-size-label-external {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    grid-column: 2;
    letter-spacing: 0.2px;
    text-align: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    position: relative;
    text-transform: uppercase;
}

.shipment-label-external {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    grid-column: 3;
    letter-spacing: 0.2px;
    text-align: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    position: relative;
    text-transform: uppercase;
}

/* Clear Value Buttons */
.clear-value-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #d32f2f;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    line-height: 1;
    font-weight: bold;
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    white-space: nowrap;
}

.clear-value-btn:hover {
    background-color: rgba(211, 47, 47, 0.1);
    color: #b71c1c;
}

/* Spezifische Positionen für verschiedene Clear-Buttons */
.clear-value-btn[data-field="founding-year"] {
    right: 45px;
}

.clear-value-btn[data-field="company-size"] {
    right: 28px;
}

.clear-value-btn[data-field="shipment"] {
    right: 66px;
}

/* Company Size Container - keine Styles mehr nötig (display: contents) */

/* Silhouetten-Container - nur die Köpfe verschieben */
.company-heads-container {
    margin-top: 0 !important;
    height: 100% !important;
    width: 100% !important;
}

.company-size-label {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-main);
    white-space: nowrap;
    letter-spacing: -0.5px;
}



/* Logo Edit Controls Styles */
.logo-edit-controls {
    position: absolute;
    top: 10px;
    left: 75px;
    width: 140px;
    height: 140px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

/* Hover-Effect: Overlay wird nur im Edit-Mode beim Hover sichtbar */
body.edit-mode-active .company-logo-container:hover .logo-edit-controls {
    opacity: 1;
    pointer-events: auto;
}

/* Upload-Button immer sichtbar im Display-Mode */
.logo-edit-controls .upload-btn {
    display: flex;
}

.logo-edit-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #FDDA0D;
    background: #f5f5f5;
    color: #255879;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-edit-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logo-edit-btn svg {
    width: 24px;
    height: 24px;
    stroke: #255879;
}

.logo-edit-btn img {
    width: 26px;
    height: 26px;
    filter: brightness(0) invert(1);
}

/* Delete Button Sichtbarkeit im Overlay */
.logo-edit-controls .delete-btn {
    display: flex !important;
}

/* Company Logo Styles */
.company-logo-container {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 290px;
}

.company-logo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background-color: rgba(37, 88, 121, 0.06);
    border: none;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 3rem;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    top: 10px;
    transition: none;
}

.company-logo.has-image {
    background: #ffffff;
    border: none;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

/* Im Edit-Mode: Rahmen wird gelb */
body.edit-mode-active .company-logo.has-image {
    box-shadow: 0 0 0 2px #FDDA0D, 0 2px 16px rgba(0,0,0,0.10);
}

/* Im Edit-Mode: Initialen-Box wird gelb mit Farbverlauf und schwarzer Schrift */
body.edit-mode-active .company-logo:not(.has-image) {
    background: linear-gradient(135deg, #FFE082, #FDDA0D);
    border-color: #FDDA0D;
    color: black;
}

.company-logo img {
    width: 88%;
    height: 88%;
    object-fit: cover;
    object-position: center center;
    border-radius: 50%;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Firmennamen unter Logo */
.company-name-display {
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    width: 290px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    box-sizing: border-box;
    border: 2px solid transparent;
    max-height: 4.2rem;
}

/* Firmennamen-Input-Feld im Edit-Mode */
.company-name-input {
    font-size: clamp(0.8rem, 12vw, 1.2rem);
    font-weight: 600;
    color: #255879;
    text-align: center;
    width: 290px;
    padding: 0;
    border: 2px solid #FDDA0D;
    border-radius: 4px;
    background-color: #f5f5f5;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    min-height: 2rem;
    max-height: 4.2rem;
    margin: 0;
    vertical-align: middle;
    resize: none;
}

.company-name-input:focus {
    border-color: #FDDA0D;
    box-shadow: 0 0 8px rgba(253, 218, 13, 0.3);
}

.company-name-input::placeholder {
    color: rgba(37, 88, 121, 0.5);
}

/* Favoriten-Herz-Icon im Profilbild */
.favorite-heart-profile {
    font-size: 24px;
    cursor: pointer;
    color: #ccc;
    transition: all 120ms ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.favorite-heart-profile {
    font-size: 28px;
    cursor: pointer;
    color: #ccc;
    transition: all 120ms ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    margin-bottom: 8px;
}

.favorite-heart-profile:hover {
    transform: scale(1.15);
}

.favorite-heart-profile.active {
    color: #e74c3c;
}

.favorite-heart-profile.active:hover {
    transform: scale(1.15);
}

/* Settings/Gear Icon im Profil-Box */
.profile-settings-btn {
    position: absolute;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.3s ease;
    padding: 0;
    z-index: 50;
    pointer-events: auto;
}

/* Default position for gear icon */
#profileSettingsBtn {
    bottom: 10px;
    left: 10px;
}

#profileSettingsBtn:hover,
#profileSettingsBtn:active,
#profileSettingsBtn:focus {
    transform: scale(1.1) rotate(20deg);
    cursor: pointer;
}

.profile-settings-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    pointer-events: none;
}

/* Zertifizierungs-Icon am kreisförmigen Profilbild */
.verification-icon {
    position: absolute;
    left: calc(50% + 34px);
    bottom: 28px;
    right: unset;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15), 0 0 0 2px rgba(255,255,255,0.9);
    transition: none;
}

.verification-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(100%);
}



/* Reihe 1-2: Linke kleine Box + Rechte große Kurzbeschreibung */
.tile-small-box {
    grid-column: 1;
    grid-row: 1;
    width: 363px;
    height: 205px;
    position: relative;
}

.tile-kurzbeschreibung {
    grid-column: 2 / -1;
    grid-row: 1;
    min-height: 205px;
    display: flex;
    flex-direction: column;
}

.about-us-description {
    position: absolute;
    top: 63px;
    left: 24px;
    right: 24px;
    bottom: 24px;
    font-family: var(--font-main);
    font-size: 15px;
    color: #255879;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
    text-align: left;
    overflow: hidden;
}

/* Display-Mode: Zusätzlicher Abstand vom Heading und größere Schriftgröße */
.about-us-description.display-mode {
    top: 70px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
}

/* Formatierung von Bold-Text in Description */
.about-us-description strong {
    font-weight: 600;
    color: var(--text-primary);
    font-family: inherit;
}

/* Formatierung von Italic-Text in Description */
.about-us-description em {
    font-style: italic;
    color: var(--text-secondary);
    font-family: inherit;
}

/* Formatierung von Stichpunkt-Quadraten in Description (Display-Mode) */
.about-us-description .bullet-point {
    color: #255879;
    font-weight: 500;
}

/* Stichpunkt-Unit (Quadrat + 3 Leerzeichen als untrennbare Einheit) */
.bullet-point-unit {
    display: inline;
    white-space: nowrap; /* Verhindert Umbruch zwischen Quadrat und Leerzeichen */
}

/* Die 3 Leerzeichen nach dem Quadrat werden hier als CSS generiert */
.bullet-point-unit::after {
    content: '   '; /* Genau 3 Leerzeichen */
    white-space: pre; /* Erhält die Leerzeichen */
}

/* Quadrat auch im Editor blau anzeigen */
#descriptionInput .bullet-point {
    color: #255879;
    font-weight: 500;
}

/* ========== CONTENTEDITABLE EDITOR STYLING ========== */
#descriptionInput {
    word-break: break-word;
    user-select: text;
}

/* Formatierung für Bold-Text im Editor */
#descriptionInput strong {
    font-weight: 700;
    color: #1a1a1a;
    font-family: inherit;
}

/* Formatierung für Italic-Text im Editor */
#descriptionInput em {
    font-style: italic;
    color: #1a1a1a;
    font-family: inherit;
}

/* Placeholder-Stil für leeren Editor */
#descriptionInput:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
    pointer-events: none;
}

/* Reihe 2-3: Linke große Allgemeine Infos + Rechte Unternehmensdata */
.tile-allgemeine-infos {
    grid-column: 1;
    grid-row: 2 / 4;
}

.tile-unternehmensdata {
    grid-column: 2 / -1;
    grid-row: 2;
    height: 205px;
}

/* Override für Tiles im Flip-Container */
.flip-front .tile-kurzbeschreibung,
.flip-front .tile-unternehmensdata {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
}

/* Reihe 3: Zwei Kacheln rechts (Karte und Branchen) */
.tile-karte {
    grid-column: 3;
    grid-row: 3;
    width: 363px;
    height: 245px;
    position: relative;
    padding: 0 !important;
    overflow: hidden;
}

.tile-karte h3 {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 500;
    margin: 0;
    pointer-events: none;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.tile-branchen {
    grid-column: 4;
    grid-row: 3;
    width: 363px;
    height: 245px;
    position: relative;
    overflow: visible;
    --kompass-x: -12px;
    --kompass-y: -12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0 !important;
}

.tile-branchen h3 {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 500;
    margin: 0;
    pointer-events: none;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    flex-shrink: 0;
}

.tile-branchen::before {
    display: none;
}

/* Map Container Styles */
.location-map-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background-color: #f2f2f7;
}

.location-map-container .leaflet-container {
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

/* Custom Marker Styles für Leaflet */
.custom-marker {
    background-color: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37, 88, 121, 0.3);
}

/* Leaflet Popup Styles */
.location-map-container .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.location-map-container .leaflet-popup-content {
    margin: 0;
    font-family: var(--font-main);
}

/* Contact Info Container & Boxes */
.tile-allgemeine-infos {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 24px !important;
    padding-top: 60px !important;
    width: 363px;
    max-width: 363px;
    overflow: visible;
}

/* Contact-Kachel Layout */
.contact-info-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    flex: 1 0 auto;
    overflow: visible;
}

/* Scrollbar-Styling entfernt, da nicht mehr gewünscht */


/* Scrollbar für Contact-Kachel im Bearbeitungsmodus */
body.edit-mode-active .tile-allgemeine-infos {
    overflow: hidden;
}

body.edit-mode-active .tile-allgemeine-infos::-webkit-scrollbar {
    width: 5px;
}

body.edit-mode-active .tile-allgemeine-infos::-webkit-scrollbar-track {
    background: rgba(37, 88, 121, 0.08);
    border-radius: 10px;
}

body.edit-mode-active .tile-allgemeine-infos::-webkit-scrollbar-thumb {
    background: rgba(37, 88, 121, 0.4);
    border-radius: 10px;
}

body.edit-mode-active .tile-allgemeine-infos::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 88, 121, 0.65);
}

.contact-info-container.edit-mode-active {
    overflow-y: scroll;
    overflow-x: hidden;
    flex: 1 1 0;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 88, 121, 0.4) rgba(37, 88, 121, 0.08);
}

.contact-info-container.edit-mode-active::-webkit-scrollbar {
    width: 5px;
}

.contact-info-container.edit-mode-active::-webkit-scrollbar-track {
    background: rgba(37, 88, 121, 0.08);
    border-radius: 10px;
}

.contact-info-container.edit-mode-active::-webkit-scrollbar-thumb {
    background: rgba(37, 88, 121, 0.4);
    border-radius: 10px;
}

.contact-info-container.edit-mode-active::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 88, 121, 0.65);
}

.contact-info-box {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--separator);
    border-radius: 0;
    padding: 14px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
    transition: none;
}

.contact-info-box:last-child {
    border-bottom: none;
}

.contact-info-box:hover {
    background: transparent;
}

.contact-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
}

.contact-label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    flex-shrink: 0;
}

.contact-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-main);
    letter-spacing: -0.1px;
}

.contact-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.contact-value {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.4;
    word-break: break-word;
    text-align: left;
    flex: 1;
    font-family: var(--font-main);
    margin-left: 32px;
}

.contact-value a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.contact-value a:hover {
    opacity: 0.7;
    text-decoration: none;
}

.contact-address {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    flex: 1;
    margin-left: 32px;
}

.contact-address div {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: var(--font-main);
}

/* Country Flag Styles */
.country-name {
    display: inline-block;
    margin-right: 8px;
}

.country-flag {
    display: inline-block;
    width: 20px;
    height: 14px;
    vertical-align: middle;
    margin-left: 4px;
    flex-shrink: 0;
    line-height: 1;
}

/* Responsive Grid */
@media (max-width: 768px) {
    main {
        height: auto !important;
        min-height: calc(var(--vh, 1vh) * 92);
        overflow-y: auto !important;
        overflow-x: hidden !important;
        justify-content: flex-start !important;
        padding-bottom: 24px !important;
    }

    body {
        height: auto !important;
        min-height: calc(var(--vh, 1vh) * 100);
        overflow-y: auto !important;
    }

    html {
        height: auto !important;
        overflow: auto !important;
    }

    .profile-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
    }

    .tile-tabs-container {
        grid-column: 1;
    }

    .tile-small-box {
        grid-column: 1;
        grid-row: auto;
        height: auto;
        min-height: unset;
        padding-bottom: 12px;
    }

    .tile-kurzbeschreibung {
        grid-column: 1;
        grid-row: auto;
    }

    .tile-allgemeine-infos {
        grid-column: 1;
        grid-row: auto;
        min-height: unset;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        height: auto !important;
    }

    .tile-unternehmensdata {
        grid-column: 1;
        grid-row: auto;
    }

    .tile-karte {
        grid-column: 1;
        grid-row: auto;
    }

    .tile-branchen {
        grid-column: 1;
        grid-row: auto;
    }

    .tile {
        min-height: 120px;
    }

    .company-logo {
        width: 100px;
        height: 100px;
        font-size: 2.2rem;
        top: 0;
    }

    .verification-icon {
        left: calc(50% + 20px);
        top: 70px;
        bottom: unset;
    }
}

/* 3D Flip Container */
.flip-container {
    grid-column: 2 / 4;
    grid-row: 1 / 3;
    perspective: 1000px;
    cursor: pointer;
    display: block;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-container.flipped .flip-inner {
    transform: rotateY(180deg);
}

.flip-front,
.flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-front {
    transform: rotateY(0deg);
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    grid-template-columns: 1fr;
}

.flip-front .tile:first-child {
    grid-row: 1;
}

.flip-front .tile:last-child {
    grid-row: 2;
}

.flip-back {
    transform: rotateY(180deg);
    display: flex;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Sekundärer Flip-Container für Section 2 <-> 3 */
.flip-container-secondary {
    width: 100%;
    height: 100%;
    perspective: 1000px;
    position: relative;
}

.flip-inner-secondary {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-container-secondary.flipped .flip-inner-secondary {
    transform: rotateY(180deg);
}

.flip-front-secondary,
.flip-back-secondary {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-front-secondary {
    transform: rotateY(0deg);
}

.flip-back-secondary {
    transform: rotateY(180deg);
}

.flip-back .tile {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
}

/* Unternehmensdata auf der Front-Side */
.flip-front {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
}

.tile-unternehmensdata {
    width: 100%;
}

.flip-front .tile-unternehmensdata {
    grid-row: 2;
}

/* Zertifizierungen Bild - zentriert */
.certification-image {
    position: absolute;
    top: 56%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
    z-index: 1;
}

/* Abfüllformen Tile - zentriert */
.tile-abfuellformen {
    position: relative !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.tile-abfuellformen h3 {
    position: absolute;
    top: 20px;
    left: 20px;
    margin: 0;
    z-index: 10;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

/* Container für alle Abfüllformen Elemente */
.abfuellformen-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Circle Chart Styles für Abfüllformen */
.circle-chart {
    position: absolute;
    width: 150px;
    height: 150px;
    z-index: 3;
    border: none;
    outline: none;
    background: transparent;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
    border: none;
    outline: none;
    background: transparent;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* Segmente Styling */
.segment {
    fill: #255879; /* Blau */
    stroke: white;
    stroke-width: 20;
    transition: all 0.3s ease;
    cursor: pointer;
    will-change: transform, filter;
    -webkit-font-smoothing: antialiased;
    -webkit-backface-visibility: hidden;
}

.segment:hover,
.segment.zoom {
    transform: scale(1.02);
    transform-origin: center;
}

.segment.blurred {
    filter: url(#segmentBlurFilter);
    opacity: 0.4;
    will-change: opacity;
}

/* Individuelle Farben für jedes Segment */
.segment-1 {
    fill: #255879; /* Blau */
}

.segment-2 {
    fill: #255879; /* Blau */
}

.segment-3 {
    fill: #255879; /* Blau */
}

.segment-4 {
    fill: #255879; /* Blau */
}

/* Blauer Hintergrundkreis für jedes Icon */
.icon-bg-circle {
    fill: #255879;
    stroke: none;
    opacity: 1;
    transition: all 0.3s ease;
}

/* Weißer Kreis in der Mitte */
.center-circle {
    fill: white;
    stroke: none;
    stroke-width: 0;
}

/* Corner Tiles - Große weiße quadratische Kacheln in den Ecken */
.corner-tile {
    position: absolute;
    width: 353px;
    height: 163px;
    background-color: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 14px;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, 110px);
    grid-auto-rows: 32px;
    column-gap: 14px;
    row-gap: 10px;
    align-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.07);
    z-index: 2;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.corner-tile:hover,
.corner-tile.zoom {
    transform: scale(1.02);
    transform-origin: center;
}

/* Positionierung der Corner Tiles */
.corner-tile-top-left {
    top: 40px;
    left: 3px;
}

.corner-tile-top-right {
    top: 40px;
    right: 3px;
    justify-content: end;
}

.corner-tile-bottom-left {
    bottom: 0px;
    left: 3px;
}

.corner-tile-bottom-right {
    bottom: 0px;
    right: 3px;
    justify-content: end;
}

/* Sub-Tiles innerhalb der Corner Tiles */
.sub-tile {
    background-color: #f5f5f7;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 7px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    padding: 2px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



/* Titel Label in Corner Tiles */
.corner-tile-label {
    position: absolute;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: none;
    z-index: 10;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
}

.corner-tile-top-left .corner-tile-label {
    top: 37px;
    right: 6px;
    left: auto;
    bottom: auto;
    transform: rotate(90deg);
    transform-origin: top right;
}

.corner-tile-top-right .corner-tile-label {
    top: 12px;
    left: 25px;
    right: auto;
    bottom: auto;
    transform: rotate(90deg);
    transform-origin: top left;
}

.corner-tile-bottom-left .corner-tile-label {
    bottom: 12px;
    right: 20px;
    transform: rotate(90deg);
    transform-origin: bottom right;
}

.corner-tile-bottom-right .corner-tile-label {
    bottom: 70px;
    left: 8px;
    transform: rotate(90deg);
    transform-origin: bottom left;
}

/* Bild in Corner Tiles */
.corner-tile-image {
    position: absolute;
    height: 70%;
    object-fit: contain;
    pointer-events: none;
    z-index: 6;
}

.corner-tile-image-left {
    left: -40px;
    top: 35%;
    transform: translateY(-50%);
    height: 110%;
}

.corner-tile-image-small {
    height: 80%;
}

.corner-tile-bottom-right .corner-tile-image-left {
    left: -19px;
    top: 60%;
}

.corner-tile-image-right {
    right: -25px;
    top: 40%;
    transform: translateY(-50%);
    height: 110%;
    max-width: 170px;
    width: auto;
    clip-path: inset(0 -100px 0 0);
}

.corner-tile-bottom-left .corner-tile-image-right {
    top: 48%;
    height: 95%;
    right: -15px;
    max-width: 190px;
}

.corner-tile-image-glass {
    right: -35px;
    top: 38%;
    height: 115%;
    max-width: none;
}

/* Abfüllformen Dropdowns - Edit Mode */
.abfuellformen-dropdown {
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.abfuellformen-select {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    border-radius: 3px;
    padding: 4px 6px;
    font-family: var(--font-main);
    font-size: 12px;
    color: var(--primary-color);
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23255879' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 18px;
}

.abfuellformen-select:hover {
    background-color: #f0f0f0;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23255879' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
}

.abfuellformen-select:focus {
    outline: none;
    background-color: #f9f9f9;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23255879' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
}

.abfuellformen-select option {
    padding: 4px;
    font-size: 13px;
}

.abfuellformen-select option:checked {
    background: linear-gradient(var(--primary-color), var(--primary-color));
    background-color: var(--primary-color);
    color: white;
}

.abfuellformen-select option:disabled {
    color: #999;
    background-color: #f5f5f5;
}



/* Zertifizierungen Tile - mit kreisförmigen Badges */
.tile-zertifizierungen {
    position: relative !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.tile-zertifizierungen h3 {
    position: absolute;
    top: 20px;
    left: 20px;
    margin: 0;
    z-index: 2;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

/* Zertifizierungskacheln - kreisförmig angeordnet */
.certification-badge {
    position: absolute;
    width: 120px;
    height: 38px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    z-index: 0;
    top: 55%;
    left: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 8 Badges in elliptischer Anordnung (horiz: 320px, vert: 180px, 45° pro Element) */
.certification-badge[style*="--index: 0"] {
    transform: translate(-50%, -50%) translate(0, -155px);
}

.certification-badge[style*="--index: 1"] {
    transform: translate(-50%, -50%) translate(209px, -110px);
}

.certification-badge[style*="--index: 2"] {
    transform: translate(-50%, -50%) translate(300px, 0);
}

.certification-badge[style*="--index: 3"] {
    transform: translate(-50%, -50%) translate(209px, 110px);
}

.certification-badge[style*="--index: 4"] {
    transform: translate(-50%, -50%) translate(0, 155px);
}

.certification-badge[style*="--index: 5"] {
    transform: translate(-50%, -50%) translate(-209px, 110px);
}

.certification-badge[style*="--index: 6"] {
    transform: translate(-50%, -50%) translate(-300px, 0);
}

.certification-badge[style*="--index: 7"] {
    transform: translate(-50%, -50%) translate(-209px, -110px);
}



/* Leaflet Zoom Control - Corporate Design */
.leaflet-control-zoom {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

/* Alle Controls vertikal stacken */
.leaflet-top.leaflet-right {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    top: 15px !important;
    right: 15px !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    background-color: transparent !important;
    border: none !important;
    color: var(--primary-color) !important;
    font-family: var(--font-main) !important;
    font-weight: 600 !important;
    font-size: 28px !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    border-radius: 6px !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    background-color: transparent !important;
    color: var(--primary-color) !important;
    box-shadow: none !important;
    transform: scale(1.15) !important;
}

.leaflet-control-zoom-in:active,
.leaflet-control-zoom-out:active {
    transform: scale(1) !important;
    box-shadow: none !important;
}

/* Recenter Button Styling */
.leaflet-control {
    margin: 0 !important;
    padding: 0 !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control > a {
    cursor: pointer !important;
}

.leaflet-control > a {
    margin: 0 !important;
    padding: 0 !important;
}

/* Leaflet Attribution - Copyright Line */
.leaflet-attribution-control {
    background-color: rgba(255, 255, 255, 0.9) !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    max-width: none !important;
    width: auto !important;
    white-space: nowrap !important;
    overflow: visible !important;
    bottom: 10px !important;
    right: 60px !important;
}

.leaflet-attribution-control a {
    color: #0078a8 !important;
}

/* ============================================
   BEARBEITUNGSMODUS - DROPDOWN STYLES
   ============================================ */

/* Dropdown Container - identisches Styling wie certification-badge */
.certification-dropdown {
    position: absolute;
    width: 120px;
    height: 38px;
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    overflow: visible;
    top: 55%;
    left: 50%;
}

/* Dropdown Hover Effekt */
.certification-dropdown:hover {
    background-color: #efefef;
    border-color: #255879;
    box-shadow: 0 2px 8px rgba(37, 88, 121, 0.2);
}

/* 8 Dropdowns in elliptischer Anordnung - IDENTISCHE POSITIONEN wie Badges */
.certification-dropdown[style*="--index: 0"] {
    transform: translate(-50%, -50%) translate(0, -155px) !important;
}

.certification-dropdown[style*="--index: 1"] {
    transform: translate(-50%, -50%) translate(209px, -110px) !important;
}

.certification-dropdown[style*="--index: 2"] {
    transform: translate(-50%, -50%) translate(300px, 0) !important;
}

.certification-dropdown[style*="--index: 3"] {
    transform: translate(-50%, -50%) translate(209px, 110px) !important;
}

.certification-dropdown[style*="--index: 4"] {
    transform: translate(-50%, -50%) translate(0, 155px) !important;
}

.certification-dropdown[style*="--index: 5"] {
    transform: translate(-50%, -50%) translate(-209px, 110px) !important;
}

.certification-dropdown[style*="--index: 6"] {
    transform: translate(-50%, -50%) translate(-300px, 0) !important;
}

.certification-dropdown[style*="--index: 7"] {
    transform: translate(-50%, -50%) translate(-209px, -110px) !important;
}

/* Select-Element für Zertifizierungen */
.certification-select {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-main);
    color: #333;
    background-color: white;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23255879' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 22px;
}

.certification-select:focus {
    outline: none;
    background-color: #f0f0f0;
}

.certification-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.certification-select option {
    background-color: white;
    color: #333;
    padding: 8px;
}

.certification-select option:disabled {
    background-color: #f0f0f0;
    color: #999;
}

/* Dropdown Content Container */
.certification-dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(37, 88, 121, 0.15);
    min-width: 250px;
    margin-top: 8px;
    display: none;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    animation: dropdownSlideDown 0.3s ease forwards;
}

@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        visibility: hidden;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

.certification-dropdown-content.open {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Dropdown Header */
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(37, 88, 121, 0.1);
    background-color: rgba(37, 88, 121, 0.05);
    border-radius: 4px 4px 0 0;
}

.dropdown-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

/* Close Button */
.dropdown-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dropdown-close-btn:hover {
    transform: scale(1.2);
    color: #d32f2f;
}

/* Dropdown Body */
.dropdown-body {
    padding: 16px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Settings Button Active State */
.profile-settings-btn.active {
    background-color: transparent !important;
    border-color: transparent !important;
}

/* ========== Certification Header & Action Buttons ========== */

/* Hidden state for buttons and tiles */
.hidden {
    display: none !important;
}

.certification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.certification-header h3 {
    margin: 0;
    flex: 1;
}

.certification-action-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.certification-save-btn,
.certification-cancel-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.certification-save-btn:hover {
    background-color: rgba(37, 88, 121, 0.1);
    transform: scale(1.05);
}

.certification-cancel-btn:hover {
    background-color: rgba(211, 47, 47, 0.1);
    border-color: #d32f2f;
    color: #d32f2f;
    transform: scale(1.05);
}

.certification-save-btn svg,
.certification-cancel-btn svg {
    width: 20px;
}

/* ========== Edit Mode Yellow Border ========== */

.certification-dropdown.edit-mode-active,
.abfuellformen-dropdown.edit-mode-active {
    border: 2px solid #FFD700 !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4) !important;
    background-color: rgba(255, 215, 0, 0.05) !important;
}

/* ========== Telefonnummer Input (Vorwahl + Nummer) ========== */

.phone-input-wrapper {
    display: flex;
    gap: 8px;
    width: 260px;
    align-items: center;
    box-sizing: border-box;
}

.country-input {
    width: 275px;
    padding: 8px 12px;
    border: 2px solid #FDDA0D;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    background-color: #f5f5f5;
    color: #255879;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23255879' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    padding-right: 30px;
    text-overflow: ellipsis;
}

.country-input:hover {
    background-color: #f9f9f9;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23255879' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.country-input:focus {
    outline: none;
    border-color: #FDDA0D;
    box-shadow: 0 0 8px rgba(253, 218, 13, 0.3);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23255879' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.country-input option {
    padding: 8px;
    background-color: white;
    color: #255879;
}

.dialing-code-select {
    flex: 0 0 68px;
    width: 68px;
    padding: 8px 8px;
    border: 2px solid #FDDA0D;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    background-color: #f5f5f5;
    color: #255879;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23255879' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 10px;
    padding-right: 20px;
    text-overflow: ellipsis;
}

.dialing-code-select:hover {
    background-color: #f9f9f9;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23255879' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
}

.dialing-code-select:focus {
    outline: none;
    border-color: #FDDA0D;
    box-shadow: 0 0 8px rgba(253, 218, 13, 0.3);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23255879' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
}

.dialing-code-select option {
    padding: 8px;
    background-color: white;
    color: #255879;
}

.phone-number-input {
    flex: 0 0 184px;
    width: 184px;
    min-width: 0;
    padding: 8px 12px;
    border: 2px solid #FDDA0D;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    background-color: #f5f5f5;
    color: #255879;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.phone-number-input::placeholder {
    color: #999;
}

.phone-number-input:focus {
    outline: none;
    border-color: #FDDA0D;
    box-shadow: 0 0 8px rgba(253, 218, 13, 0.3);
}

/* ============================================
   BRANCHES/INDUSTRIES ICONS STYLING
   ============================================ */

.branches-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    width: 100% !important;
    height: 65% !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-items: stretch !important;
    align-items: stretch !important;
    background: none !important;
    position: absolute;
    top: 25%;
    left: 0;
    right: 0;
    z-index: 10;
    filter: none !important;
    mix-blend-mode: normal;
}

.branches-grid::before {
    display: none !important;
}

.branches-grid::after {
    display: none !important;
}

.branch-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    gap: 4px;
    padding: 15px;
    position: relative;
    width: 80px;
}

/* Positioniere Icons zu den vier Ecken/Rändern */
.branch-icon:nth-child(1) {
    justify-self: start !important;
    align-self: end !important;
    margin-left: 40px;
    flex-direction: column-reverse;
    margin-top: -30px;
}

.branch-icon:nth-child(2) {
    justify-self: end !important;
    align-self: end !important;
    margin-right: 40px;
    flex-direction: column-reverse;
    margin-top: -30px;
}

.branch-icon:nth-child(3) {
    justify-self: start !important;
    align-self: start !important;
    margin-left: 40px;
    margin-top: 15px;
}

.branch-icon:nth-child(4) {
    justify-self: end !important;
    align-self: start !important;
    margin-right: 40px;
    margin-top: 15px;
}

.branch-icon-container {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #2d6e95, #255879);
    box-shadow: 
        0 4px 12px rgba(37, 88, 121, 0.3),
        0 1px 3px rgba(37, 88, 121, 0.2);
    transition: all 0.25s ease;
}

.branch-icon.active .branch-icon-container {
    background: linear-gradient(145deg, #2d6e95, #255879);
    box-shadow: 
        0 4px 12px rgba(37, 88, 121, 0.3),
        0 1px 3px rgba(37, 88, 121, 0.2);
}

.branch-icon.inactive {
    visibility: hidden;
    pointer-events: none;
}

.branches-grid.edit-mode .branch-icon.inactive {
    visibility: visible;
    pointer-events: auto;
    opacity: 0.3;
}

.branch-icon.inactive .branch-icon-container {
    background: linear-gradient(145deg, #2d6e95, #255879);
    box-shadow: 
        0 4px 12px rgba(37, 88, 121, 0.3),
        0 1px 3px rgba(37, 88, 121, 0.2);
}

.branch-icon-container img,
.branch-icon-container svg {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: filter 0.3s ease;
    filter: brightness(0) invert(1);
}

.branch-icon-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.branch-icon.active .branch-icon-container img,
.branch-icon.active .branch-icon-container svg {
    filter: brightness(0) invert(1);
}

.branch-icon.active .branch-icon-container .branch-icon-img {
    filter: brightness(0) invert(1);
}

.branch-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

.branches-grid.edit-mode .branch-label {
    color: #FDDA0D;
}

.branch-icon:hover {
    transform: scale(1.1);
}



/* Edit Mode Styles */
.branches-grid.edit-mode {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
    justify-items: stretch !important;
    align-items: stretch !important;
}

.branches-grid.edit-mode .branch-icon.inactive {
    display: flex !important;
}

/* Behalte Ecken-Positionierung auch im Edit-Mode */
.branches-grid.edit-mode .branch-icon:nth-child(1) {
    justify-self: start !important;
    align-self: end !important;
    margin-left: 40px;
    flex-direction: column-reverse;
    margin-top: -30px;
}

.branches-grid.edit-mode .branch-icon:nth-child(2) {
    justify-self: end !important;
    align-self: end !important;
    margin-right: 40px;
    flex-direction: column-reverse;
    margin-top: -30px;
}

.branches-grid.edit-mode .branch-icon:nth-child(3) {
    justify-self: start !important;
    align-self: start !important;
    margin-left: 40px;
    margin-top: 15px;
}

.branches-grid.edit-mode .branch-icon:nth-child(4) {
    justify-self: end !important;
    align-self: start !important;
    margin-right: 40px;
    margin-top: 15px;
}

.branches-grid.edit-mode .branch-icon-container {
    background: rgba(253, 218, 13, 0.9) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 
        0 8px 32px 0 rgba(253, 218, 13, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3) !important;
}

.branches-grid.edit-mode .branch-icon-container img,
.branches-grid.edit-mode .branch-icon-container .branch-icon-img {
    filter: brightness(0) !important;
}

.branches-grid.edit-mode .branch-label {
    color: #255879 !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

/* Circle Chart Background - absolut positioniert */
.branches-circle-chart-background {
    position: absolute;
    width: 220px;
    height: 220px;
    z-index: 3;
    border: none;
    outline: none;
    background: transparent;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.branches-circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
    border: none;
    outline: none;
    background: transparent;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

/* Branch Segmente mit Farbcodierung */
.branch-segment {
    fill: #255879;
    stroke: white;
    stroke-width: 20;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
    cursor: pointer;
    shape-rendering: geometricPrecision;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-svg-shadow: none;
}

.branch-segment:hover {
    transform: scale(1.04);
    transform-origin: center;
}

.branch-segment.blurred {
    filter: blur(3px);
    opacity: 0.4;
}

.branches-grid.edit-mode .branch-segment {
    fill: #FDDA0D;
}

.branch-segment-1 {
    cursor: pointer;
}

.branch-segment-2 {
    cursor: pointer;
}

.branch-segment-3 {
    cursor: pointer;
}

.branch-segment-4 {
    cursor: pointer;
}

/* Branch Center Circle */
.branch-center-circle {
    fill: white;
    stroke: none;
}

/* Branch Icons Styling */
.branch-icon.active .branch-icon-container svg {
    filter: brightness(0) invert(1) !important;
}

/* Responsive Branch Icons */
@media (max-width: 768px) {
    .branch-icon-container {
        width: 45px;
        height: 45px;
    }
    
    .branch-icon-container img,
    .branch-icon-container svg {
        width: 35px;
        height: 35px;
    }
    
    .branch-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .branch-icon-container {
        width: 40px;
        height: 40px;
    }
    
    .branch-icon-container img,
    .branch-icon-container svg {
        width: 30px;
        height: 30px;
    }
    
    .branch-label {
        font-size: 10px;
    }
}

/* Source Footer für Limited Profiles */
.source-footer {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: -20px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 100;
}

.source-footer a {
    color: var(--text-tertiary);
    text-decoration: underline;
    font-weight: 400;
    cursor: pointer;
}

.source-footer a:hover {
    opacity: 0.7;
}

#sidebarSettingsBtn, #sidebarSaveBtn {
    margin-top: auto;
}

.abo-info {
    position: relative;
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: rgba(0,0,0,0.05);
    border: none;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    text-align: center;
    white-space: normal;
    letter-spacing: 0.2px;
    line-height: 1.2;
    max-width: 60px;
    transform: rotate(-90deg);
}

/* Profile Sidebar Navigation */
.profile-sidebar {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 20px 0 !important;
    gap: 15px !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: var(--tile-shadow) !important;
    min-height: 100% !important;
    height: 100% !important;
    align-self: stretch !important;
}

.sidebar-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 4px;
    position: relative;
}

.sidebar-nav-item svg {
    width: 22px;
    height: 22px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: var(--text-secondary);
}

.sidebar-nav-item.active svg {
    stroke: var(--primary-color);
}

.sidebar-label {
    font-size: 9px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.7;
    color: var(--text-secondary);
    letter-spacing: 0.1px;
}

.sidebar-nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: rgba(37, 88, 121, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    border: none;
}

.sidebar-nav-item.active::after {
    content: '';
    position: absolute;
    right: -15px;
    width: 3px;
    height: 20px;
    background: #255879;
    border-radius: 2px 0 0 2px;
}

body.edit-mode-active #sidebarSaveBtn {
    color: #FDDA0D;
    background: linear-gradient(135deg, rgba(253, 218, 13, 0.2), rgba(253, 218, 13, 0.15));
    border: 1.5px solid rgba(253, 218, 13, 0.3);
    font-weight: 600;
}

body.edit-mode-active #sidebarSaveBtn svg {
    stroke: #FDDA0D;
}

body.edit-mode-active #sidebarSaveBtn::after {
    content: '';
    position: absolute;
    right: -15px;
    width: 3px;
    height: 20px;
    background: #FDDA0D;
    border-radius: 2px 0 0 2px;
}

.mobile-edit-controls {
    display: none;
}

/* Subscription Pop-up Styles */
.contact-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease-in-out;
    padding: 20px;
    font-family: var(--font-main);
}

.contact-popup.show {
    display: flex !important;
    opacity: 1;
}

.contact-popup-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 4px 20px rgba(0,0,0,0.08);
    width: 600px;
    max-width: calc(100vw - 40px);
    padding: 40px 50px;
    text-align: left;
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.contact-popup-header {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.contact-popup-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.contact-popup-close {
    width: 24px;
    height: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-popup-close:hover {
    color: #666;
}

.contact-popup-close svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
}

.contact-popup-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact-info-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    align-items: start;
}

.contact-info-item:first-child {
    padding-top: 0;
}

.contact-info-item:last-child {
    border-bottom: none;
}

.contact-info-label {
    font-weight: 500;
    color: var(--text-tertiary);
    font-size: 14px;
    padding-top: 2px;
}

.contact-info-value {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.7;
    word-break: break-word;
    font-weight: 400;
}

.contact-info-value.highlight {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 16px;
}

.abo-popup-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.abo-cancel-btn, .abo-contact-btn {
    padding: 15px 30px;
    border: 1.5px solid var(--primary-color);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex: 1;
    background: white;
}

.abo-cancel-btn {
    color: #dc3545;
    border-color: #dc3545;
}

.abo-cancel-btn:hover {
    background: rgba(220, 53, 69, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
}

.abo-contact-btn {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.abo-contact-btn:hover {
    background: rgba(37, 88, 121, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 88, 121, 0.15);
}

/* Blur-Effekt für Hintergrund */
body.modal-open > *:not(.contact-popup) {
    filter: blur(8px);
    pointer-events: none;
}

/* Responsive Design Header Copy from Impressum */
@media (max-width: 768px) {
    header {
        grid-template-columns: 1fr auto 1fr;
        padding: 0 15px;
        z-index: 1000 !important;
    }

    h1 {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 20px;
    }

    .header-logo {
        font-size: 0;
        display: flex;
        align-items: center;
    }

    .header-logo img {
        font-size: initial;
        height: 5vh;
        width: auto;
    }

    .user-profile {
        padding: 0 !important;
        gap: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .user-profile:hover {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .profile-name {
        display: none !important;
    }

    .profile-avatar {
        width: 36px !important;
        height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
        font-size: 14px;
    }

    .menu-toggle svg {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
    }

    .menu-dropdown {
        top: calc(var(--vh, 1vh) * 8) !important;
        padding: 0 !important;
        height: auto !important;
        max-height: calc(var(--vh, 1vh) * 92) !important;
        overflow-y: auto !important;
        border-bottom: 1px solid rgba(204, 204, 204, 0.3) !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
        display: none;
        width: 100% !important;
        min-width: auto !important;
        left: 0 !important;
    }

    .menu-dropdown.show {
        display: block !important;
    }

    .menu-dropdown-columns {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .menu-dropdown-column {
        width: 100% !important;
        border-bottom: 1px solid rgba(37, 88, 121, 0.1);
        padding: 0 !important;
    }

    .menu-dropdown-column:last-child {
        border-bottom: none !important;
    }

    .menu-dropdown-column-title {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        cursor: pointer !important;
        padding: 15px 20px !important;
        margin: 0 !important;
        font-size: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .menu-dropdown-column-title::after {
        content: '▼';
        font-size: 10px;
        transition: transform 0.3s ease;
        color: #255879;
    }

    .menu-dropdown-column.active .menu-dropdown-column-title::after {
        transform: rotate(180deg);
    }

    .menu-dropdown-item {
        display: none !important;
        padding: 12px 30px !important;
        font-size: 14px !important;
        text-align: left !important;
        width: 100% !important;
        background: transparent !important;
        border: none !important;
        color: #555 !important;
    }

    .menu-dropdown-column.active .menu-dropdown-item {
        display: block !important;
    }

    .menu-dropdown-footer {
        display: none !important;
    }

    /* Sidebar in mobiler Ansicht ausblenden */
    .profile-sidebar {
        display: none !important;
    }

    /* Mobile Edit Controls auf der Profilbild-Kachel */
    .mobile-edit-controls.is-owner {
        position: absolute !important;
        top: 12px !important;
        left: 12px !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        z-index: 10 !important;
    }

    .mobile-edit-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        border: 1px solid rgba(255, 255, 255, 0.6) !important;
    }

    .mobile-edit-btn svg {
        width: 20px !important;
        height: 20px !important;
        stroke: var(--primary-color) !important;
    }

    .mobile-save-btn {
        display: none !important;
    }

    body.edit-mode-active #mobileSettingsBtn {
        display: none !important;
    }

    body.edit-mode-active .mobile-save-btn {
        display: flex !important;
        background: linear-gradient(135deg, rgba(253, 218, 13, 0.25), rgba(253, 218, 13, 0.2)) !important;
        border: 1.5px solid rgba(253, 218, 13, 0.4) !important;
    }

    body.edit-mode-active .mobile-save-btn svg {
        stroke: #FDDA0D !important;
    }

    .dropdown-item {
        font-size: 14px !important;
        padding: 1.5vh 4vw;
    }

    .dropdown-menu {
        min-width: 180px !important;
    }

    .profile-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        grid-auto-rows: auto !important;
        width: 100% !important;
        max-width: 363px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        justify-content: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
    }

    .profile-container > * {
        grid-column: auto !important;
        grid-row: auto !important;
        width: 100% !important;
    }

    .source-footer {
        justify-self: center !important;
        margin-top: 10px !important;
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        order: 100; /* Sicherstellen, dass es am Ende steht */
    }

    /* Hover-Effekte in mobiler Ansicht deaktivieren */
    .tile:hover {
        transform: none !important;
        box-shadow: var(--tile-shadow) !important;
    }

    /* Nur Profilbild- und Kontaktkachel anzeigen */
    .flip-container,
    .tile-karte,
    .tile-branchen {
        display: none !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 18px;
    }
}

