/* ====================================================================================
   DASHBOARD & ALL ELEMENTS (LI INDUSTRIES) - 1168PX DESKTOP & STRICT 0 RADIUS
   ==================================================================================== */
   html, body { 
    margin: 0; 
    padding: 0; 
    min-height: 100%; 
    height: auto; 
    font-family: var(--font-primary, ui-sans-serif, system-ui, -apple-system, sans-serif); 
    color: var(--text-primary, rgba(0,0,0,0.9)); 
    letter-spacing: -0.015em;
    -webkit-text-size-adjust: 100%;
}

/* ====================================================================================
   AUTH / LOGIN VIEW (Zentriert 540px)
   ==================================================================================== */
body.auth-view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.auth-view header {
    position: relative;
    z-index: 10;
    max-width: 540px !important;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacer-medium, 6vh) 16px 0 16px;
    box-sizing: border-box;
}
body.auth-view .login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px 0;
}
body.auth-view .login-wrapper .container { 
    width: 100%; 
    max-width: 540px !important;
    text-transform: uppercase; 
}
body.auth-view .header-menu {
    max-width: 540px !important;
    margin: 0 auto 30px auto !important;
}

/* ====================================================================================
   DASHBOARD VIEW: Entsprechend Instructions auf max. 940px begrenzt
   ==================================================================================== */
   body.dashboard-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px 60px 20px !important;
    margin: 0 !important;
    box-sizing: border-box;
    text-transform: uppercase;
    width: 100%;
}

body.dashboard-view .container {
    width: 100% !important;
    max-width: 1200px !important; /* MUSS 940px sein */
    margin: 0 auto !important;
}

/* FIXIERTE LEISTE (HEADER + SEARCH + NEW POST) */
body.dashboard-view .dashboard-sticky-top {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background: rgba(255, 255, 255, 0.82) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    padding-top: var(--spacer-medium, 4vh) !important;
    padding-bottom: 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-bottom: 0.5px solid var(--border, rgba(0, 0, 0, 0.1)) !important;
}

body.dashboard-view .header-menu-container,
body.dashboard-view .new-post-wrapper,
body.dashboard-view .controls-bar,
body.dashboard-view .cards-grid {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

body.dashboard-view .header-menu-container {
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: stretch !important;
}

body.dashboard-view .header-menu {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important; /* Von 36px auf 44px */
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    gap: 6px !important;
}

body.dashboard-view .header-menu__item {
    flex: 1 1 0;
    min-width: 0;
    height: 44px; /* Von 36px auf 44px */
    line-height: 42px;
    padding: 0 8px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    color: var(--text-primary, #000000);
    font-size: var(--font-size-small, 12px);
    font-weight: 500;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    border-radius: 0 !important;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}
body.dashboard-view .header-menu__item:hover,
body.dashboard-view .header-menu__item.active {
    opacity: 1;
    border-color: rgba(0, 0, 0, 0.8);
}

/* ====================================================================================
   KEINE ABGERUNDETEN ECKEN (0 RADIUS) FÜR ALLE FIELDS, HEADER & FOOTER
   ==================================================================================== */
body.dashboard-view input,
body.dashboard-view textarea,
body.dashboard-view select,
body.dashboard-view .btn,
body.dashboard-view .header-menu,
body.dashboard-view .header-menu__item,
body.dashboard-view .unified-media-field,
body.dashboard-view .entry-card img,
body.dashboard-view .custom-select-trigger,
body.dashboard-view .custom-select-options,
body.dashboard-view .custom-file-trigger,
body.dashboard-view .new-post-header,
footer input,
footer textarea,
footer button,
footer .btn {
    border-radius: 0 !important;
}

/* ====================================================================================
   NEW POST ACCORDION
   ==================================================================================== */
   .new-post-wrapper {
    margin: 0 !important;
    border: none;
    background: transparent;
}
.new-post-header {
    width: 100%;
    height: 44px; /* Apple HIG Target-Höhe */
    background: #000000;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 16px;
    box-sizing: border-box;
    cursor: pointer;
    font-size: var(--font-size-small, 12px);
    font-weight: 500;
    letter-spacing: -0.015em;
    user-select: none;
    text-align: center;
    transition: opacity 0.2s ease;
}
.new-post-header:hover { opacity: 0.9; }

.new-post-toggle-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}
.new-post-toggle-icon span {
    display: block;
    width: 100%;
    height: 1px;
    background: #ffffff;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.new-post-header.is-open .new-post-toggle-icon span:first-child {
    transform: translateY(4.5px) rotate(45deg);
}
.new-post-header.is-open .new-post-toggle-icon span:last-child {
    transform: translateY(-4.5px) rotate(-45deg);
}

.new-post-body {
    padding: 15px 0 0 0;
    display: none;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
}
.new-post-body.open {
    display: flex;
}

/* ====================================================================================
   UNIFIED MEDIA FIELD & BROWSE BUTTON (GARANTIERT OHNE RAND)
   ==================================================================================== */
   .unified-media-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px; /* Von 36px auf 44px */
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    box-sizing: border-box;
    padding: 2px 4px 2px 16px;
    transition: border-color 0.2s ease;
}
.unified-media-field:focus-within,
.unified-media-field.dragover {
    border-color: rgba(0, 0, 0, 0.8);
}
.unified-media-field input[type="text"] {
    flex: 1;
    width: auto;
    height: 100%;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: var(--font-size-small, 12px) !important;
    text-align: left !important;
    text-align-last: left !important;
    outline: none !important;
    box-shadow: none !important;
}

.unified-media-browse-btn,
button.unified-media-browse-btn {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    height: 100% !important;
    line-height: 32px !important;
    padding: 0 12px !important;
    color: var(--text-primary, #000000) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.unified-media-browse-btn:hover {
    opacity: 0.6 !important;
}

/* ====================================================================================
   BURGER MIT EXAKT 2 STRICHEN PRO EINTRAG
   ==================================================================================== */
.caption-toggle-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.caption-toggle-wrapper input {
    border-radius: 0 !important;
    padding-right: 44px !important;
}
.burger-toggle-btn {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    width: 40px !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 !important;
    z-index: 3;
}
.burger-toggle-btn span {
    display: block;
    width: 16px;
    height: 1px;
    background: #000000;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.burger-toggle-btn.is-open span:first-child {
    transform: translateY(3px) rotate(45deg);
}
.burger-toggle-btn.is-open span:last-child {
    transform: translateY(-3px) rotate(-45deg);
}

/* ====================================================================================
   CUSTOM SELECT
   ==================================================================================== */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}
.custom-select-wrapper select {
    display: none !important;
}
.custom-select-trigger {
    width: 100%;
    height: 44px; /* Von 36px auf 44px */
    line-height: 42px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    color: var(--text-primary, #000000);
    font-size: var(--font-size-small, 12px);
    font-weight: 500;
    padding: 0 16px;
    box-sizing: border-box;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 0.2s ease;
}
.custom-select-trigger:hover,
.custom-select-wrapper.open .custom-select-trigger {
    border-color: rgba(0, 0, 0, 0.8);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.8);
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.custom-select-wrapper.open .custom-select-options {
    display: block;
}
.custom-select-option {
    padding: 8px 16px;
    font-size: var(--font-size-small, 12px);
    font-weight: 500;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease;
}
.custom-select-option:hover,
.custom-select-option.highlighted {
    background: rgba(0, 0, 0, 0.05);
}

/* ====================================================================================
   CUSTOM FILE WRAPPER
   ==================================================================================== */
.custom-file-wrapper {
    position: relative;
    width: 100%;
}
.custom-file-wrapper input[type="file"] {
    display: none !important;
}
.custom-file-trigger {
    width: 100%;
    height: 44px; /* Von 36px auf 44px */
    line-height: 42px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    color: var(--text-primary, #000000);
    font-size: var(--font-size-small, 12px);
    font-weight: 500;
    padding: 0 16px;
    box-sizing: border-box;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.custom-file-trigger:hover {
    border-color: rgba(0, 0, 0, 0.8);
}

/* ====================================================================================
   STANDARDFELDER (INPUTS, TEXTAREAS, BUTTONS)
   ==================================================================================== */
   body.dashboard-view form input[type="text"],
   body.dashboard-view form input[type="password"],
   body.dashboard-view form input[type="datetime-local"],
   body.dashboard-view form select,
   body.dashboard-view form .btn,
   body.auth-view form input,
   body.auth-view form .btn {
       width: 100%;
       height: 44px; /* Von 36px auf 44px */
       line-height: 42px;
       background: var(--bg-primary, #ffffff);
       border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
       color: var(--text-primary, #000000);
       font-size: var(--font-size-small, 12px);
       font-weight: 500;
       padding: 0 16px;
       box-sizing: border-box;
       text-transform: uppercase;
       text-align: center;
       text-align-last: center;
       outline: none;
       transition: border-color 0.2s ease, background 0.2s ease;
   }

body.dashboard-view form input[type="text"]:focus,
body.dashboard-view form select:focus,
body.dashboard-view form .btn:hover {
    border-color: rgba(0, 0, 0, 0.8);
}

body.dashboard-view textarea {
    width: 100%;
    min-height: 70px;
    padding: 10px 16px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    color: var(--text-primary, #000000);
    font-size: var(--font-size-small, 12px);
    font-weight: 500;
    box-sizing: border-box;
    outline: none;
    resize: vertical;
}
body.dashboard-view textarea:focus {
    border-color: rgba(0, 0, 0, 0.8);
}

/* ====================================================================================
   CONTROLS BAR (4 SPALTEN, BÜNDIG)
   ==================================================================================== */
   .controls-bar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 0 0 15px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    .controls-bar {
        grid-template-columns: auto 2fr 1fr 1fr !important;
    }
}

.controls-bar input,
.controls-bar select,
.controls-bar .custom-select-trigger,
.controls-bar .btn-refresh {
    height: 44px !important; /* Apple HIG Target-Höhe */
    line-height: 42px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1)) !important;
    background: #ffffff !important;
    font-family: inherit !important;
    font-size: var(--font-size-small, 12px) !important;
    letter-spacing: -0.015em !important;
    text-align: center !important;
    text-align-last: center !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    width: 100% !important;
}

.controls-bar .custom-select-wrapper {
    width: 100% !important;
}

.controls-bar .btn-refresh { 
    cursor: pointer !important; 
    white-space: nowrap !important; 
    background: #000000 !important; 
    color: #ffffff !important; 
    border: 1px solid #000000 !important;
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    gap: 6px !important; 
    text-decoration: none !important; 
    width: auto !important;
    padding: 0 18px !important;
    transition: opacity 0.2s ease !important;
}
.controls-bar .btn-refresh:hover { 
    opacity: 0.85 !important;
}

.controls-bar input#live-search {
    text-align: left !important;
    text-align-last: left !important;
    color: #000000 !important;
}
.controls-bar input#live-search:focus,
.controls-bar select:focus,
.controls-bar .custom-select-trigger:hover {
    border-color: rgba(0, 0, 0, 0.8) !important;
}

/* ====================================================================================
   CARDS GRID & CARDS
   ==================================================================================== */
.cards-grid { 
    display: grid !important; 
    grid-template-columns: 1fr !important; 
    gap: 30px !important; 
    margin: 0 auto !important;
}
@media (min-width: 768px) {
    .cards-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}

.entry-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}
.entry-card form { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    width: 100%;
}
.entry-card img { 
    width: 100%; 
    display: block; 
    aspect-ratio: 4 / 5; 
    object-fit: cover; 
    border: 1px solid var(--border, rgba(0,0,0,0.1)); 
    margin-bottom: 20px; 
}
.entry-card img.filter-grayscale { filter: grayscale(100%); }
.entry-card img.filter-cinematic { filter: contrast(115%) brightness(95%) sepia(20%) hue-rotate(180deg) saturate(110%); }

/* ALERTS */
.alert {
    padding: 12px 16px;
    font-size: var(--font-size-small, 12px);
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
    border: 1px solid;
    box-sizing: border-box;
}
.alert.success {
    background: #e6f4ea;
    border-color: #34a853;
    color: #137333;
}
.alert.error {
    background: #fce8e6;
    border-color: #ea4335;
    color: #c5221f;
}

/* ====================================================================================
   PAGINATION BAR (FONT 12PX, NEXT STRIKT RECHTSBÜNDIG)
   ==================================================================================== */
   .pagination-bar {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    height: 44px !important; /* Von 36px auf 44px */
    margin-top: 30px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.pagination-bar__btn { 
    flex: 1 1 0 !important; 
    height: 44px !important; /* Von 36px auf 44px */
    line-height: 42px !important;
    font-size: var(--font-size-small, 12px) !important;
    font-weight: 500 !important;
    padding: 0 16px !important;
    text-decoration: none !important;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1)) !important;
    background: var(--bg-primary, #ffffff) !important;
    color: var(--text-primary, #000000) !important;
    border-radius: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

.pagination-bar__btn:first-child {
    justify-content: flex-start !important;
    text-align: left !important;
    text-align-last: left !important;
}

.pagination-bar__btn:last-child {
    justify-content: flex-end !important;
    text-align: right !important;
    text-align-last: right !important;
}

.pagination-bar__btn:hover {
    border-color: rgba(0, 0, 0, 0.8) !important;
}
.pagination-bar__btn--disabled {
    opacity: 0.3 !important;
    pointer-events: none !important;
}

.pagination-bar__select-wrap { 
    flex: 2 1 0 !important; 
    height: 44px !important; 
    margin: 0 !important; 
    z-index: 2 !important; 
    position: relative !important;
}

.pagination-bar__select,
.pagination-bar__select-wrap .custom-select-trigger { 
    width: 100% !important; 
    height: 44px !important; /* Von 36px auf 44px */
    line-height: 42px !important;
    font-size: var(--font-size-small, 12px) !important;
    font-weight: 500 !important;
    border-radius: 0 !important;
    text-align: center !important;
    text-align-last: center !important;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1)) !important;
    background: #ffffff !important;
    cursor: pointer !important;
    padding: 0 12px !important;
}

footer { 
    width: 100%; 
    margin-top: auto; 
}