/* ============================================================================
   DATEV hr:exchange Interface – app.css
   ============================================================================ */

/* ── CSS-Variablen ───────────────────────────────────────────────────────── */
:root {
    --blue:          #005A9C;
    --blue-dark:     #003F6E;
    --blue-light:    #EAF2FA;
    --blue-accent:   #4fa8da;;
    --red:           #B91C1C;
    --orange:        #C2410C;
    --green-dark:    #14532D;
    --border:        #D1D9E6;
    --bg:            #F1F3F7;
    --surface:       #FFFFFF;
    --text:          #111827;   /* sehr dunkel – immer auf hellen Flächen */
    --text-muted:    #4B5563;
    --text-light:    #FFFFFF;   /* immer auf dunklen Flächen */
    --topbar-h:      56px;
    --topbar-bg:     #002D57;   /* noch etwas dunkler für besseren Kontrast */
}

/* ── Reset & Basis ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html
{
	height: 100%;
	background: var(--bg);
}

body {
    height: 100%;
    margin: 0;
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════════
   APP-LAYOUT: Topbar | Main (flex-grow) | Footer
   → Footer klebt immer am unteren Rand
══════════════════════════════════════════════════════════════════════════ */
body.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-main {
    flex: 1 0 auto;   /* nimmt gesamten freien Raum ein */
    display: flex;
    flex-direction: column;
}

.page-content
{
    padding: 24px 20px 32px;
    flex: 1;
	max-width: 1600px;
}

.datev-footer {
    flex-shrink: 0;   /* wird nie zusammengedrückt */
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 11px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════════════════════════ */
.topbar {
    background: var(--topbar-bg);
    border-bottom: 3px solid var(--blue-accent);
    height: var(--topbar-h);
    position: sticky;
    top: 0;
    z-index: 980;
    flex-shrink: 0;
}

/* Einziger Flex-Container – alles vertikal mittig */
.topbar-inner {
    display: flex;
    align-items: center;       /* ← vertikale Zentrierung aller Elemente */
    height: var(--topbar-h);
    padding: 0 16px;
    gap: 4px;
}

/* ── Logo ──────────────────────────────────────────────────────────────── */
.topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex: 0 0 auto;            /* eigene Breite, nicht erzwungen */
    min-width: 180px;
    padding: 0 12px 0 0;
    color: var(--text-light);
}
.topbar-logo:hover { text-decoration: none; opacity: .9; }
.topbar-logo-icon  { font-size: 17px; color: #5CC8FF; }
.topbar-logo-name  { font-size: 15px; font-weight: 700; color: var(--text-light); }
.topbar-logo-sub   { font-size: 12px; color: rgba(255,255,255,.55); margin-left: 2px; }

/* ── Nav-Links Mitte ───────────────────────────────────────────────────── */
.topbar-nav
{
    display: flex;
    align-items: center;
    justify-content: center;   /* ← zentriert innerhalb des flex:1-Bereichs */
    gap: 2px;
    flex: 1;
}

.topbar-nav-link
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 36px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.78) !important;
    text-decoration: none;
    white-space: nowrap;
    transition: background .14s, color .14s;
}
.topbar-nav-link i
{
	font-size: 14px;
}
.topbar-nav-link:hover {
    background: rgba(255,255,255,.11);
    color: var(--text-light) !important;
    text-decoration: none;
}
.topbar-nav-link.is-active {
    background: rgba(255,255,255,.15);
    color: var(--text-light) !important;
    font-weight: 600;
}

/* ── Rechter Bereich ───────────────────────────────────────────────────── */
.topbar-right
{
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;            /* auto-Breite – kein Abschneiden mehr */
    min-width: 180px;
    justify-content: flex-end;
    margin-left: auto;         /* schiebt sich ans rechte Ende */
}

/* API-Status Badge */
.datev-status-badge
{
    display: inline-flex;
	min-width: 110px;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.92);          /* heller Grundtext */
    border: 1px solid rgba(255,255,255,.35);
    background-color: rgba(255,255,255,.1);      /* leicht aufgehellt */
    white-space: nowrap;
    cursor: default;
    transition: border-color .2s, color .2s, background .2s;
}
.datev-status-badge.is-connected
{
	color: #86EFAC;
	border-color: rgba(134,239,172,.55);
	background: rgba(134,239,172,.12);
}
.datev-status-badge.is-disconnected
{
	color: #FCA5A5;
	border-color: rgba(252,165,165,.55);
	background: rgba(252,165,165,.12);
}
.datev-status-badge.is-checking
{
	color: #FDE68A;
	border-color: rgba(253,230,138,.45);
	background: rgba(253,230,138,.1);
}

.datev-status-badge i
{
	font-size: 12px;
}

/* User-Button */
.user-menu-wrap
{
	position: relative;
}
.user-menu-btn
{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.88);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s;
}
.user-menu-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.user-menu-btn .fa-circle-user { font-size: 16px; }
.user-menu-chevron { font-size: 10px; opacity: .7; }
.user-menu-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

/* Dropdown */
.topbar-dropdown
{
    min-width: 190px;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,.15);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0 0 6px 0;
}
.dropdown-header
{
    padding: 5px 14px 8px;
    border-bottom: 1px solid var(--border);
	border-top-left-radius: 8px;
	border-top-right-radius: 8px;
    margin-bottom: 4px;
	background-color: var(--bg);
}
.dropdown-user-name
{
    font-size: 13px;
    font-weight: 600;
    color: var(--text);      /* dunkel auf weißem Hintergrund */
}
.dropdown-user-role
{
    font-size: 11px;
    color: var(--text-muted);
}
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--text) !important;       /* dunkel auf weißem Grund */
    text-decoration: none;
    transition: background .1s;
}
.dropdown-item:hover {
    background: var(--blue-light);
    color: var(--blue-dark) !important;
    text-decoration: none;
}
.dropdown-item i { width: 14px; text-align: center; color: var(--text-muted); }
.dropdown-item-danger        { color: var(--red) !important; }
.dropdown-item-danger i      { color: var(--red); }
.dropdown-item-danger:hover  { background: #FEF2F2; color: var(--red) !important; }

/* Mobil-Burger */
.topbar-burger {
    background: none;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 5px;
    color: rgba(255,255,255,.85);
    font-size: 15px;
    padding: 5px 9px;
    cursor: pointer;
    transition: background .14s;
}
.topbar-burger:hover { background: rgba(255,255,255,.12); }

/* Mobile Drawer */
.mobile-drawer { background: var(--blue-dark) !important; }
.mobile-drawer-logo {
    color: rgba(255,255,255,.9);
    font-size: 14px;
    font-weight: 700;
    padding: 4px 0 20px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    margin-bottom: 8px;
}
.mobile-nav { display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    color: rgba(255,255,255,.8) !important;
    font-size: 14px;
    text-decoration: none;
    transition: background .14s;
}
.mobile-nav-link:hover, .mobile-nav-link.is-active {
    background: rgba(255,255,255,.12);
    color: #fff !important;
	text-decoration: none;
}
.mobile-nav-link-danger { color: #FCA5A5 !important; }
.mobile-nav-link-danger:hover { background: rgba(220,38,38,.2) !important; }
.mobile-nav-divider { border: none; border-top: 1px solid rgba(255,255,255,.15); margin: 8px 0; }

/* ── UIkit Notification → Flash-Box-Stil ─────────────────────────────────── */
/* Container oben-mittig, volle Breite */
.uk-notification-top-center {
    top: calc(var(--topbar-h) + 12px);
    left: 20px;
    right: 20px;
    width: auto;
    max-width: 720px;
    margin: 0 auto;
}
/* Einzelne Notification-Box */
.uk-notification-message {
    background: var(--surface);
    border-left: 4px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);
    padding: 14px 36px 14px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    position: relative;
}
.uk-notification-message .uk-notification-close {
    top: 10px;
    right: 10px;
}
/* Status-Farben wie uk-alert */
.uk-notification-message-success {
    border-left-color: #22C55E;
    background: #F0FDF4;
    color: #14532D;
}
.uk-notification-message-danger {
    border-left-color: #EF4444;
    background: #FEF2F2;
    color: #7F1D1D;
}
.uk-notification-message-warning {
    border-left-color: #F59E0B;
    background: #FFFBEB;
    color: #78350F;
}
.uk-notification-message-primary {
    border-left-color: var(--blue-accent);
    background: var(--blue-light);
    color: var(--blue-dark);
}

/* ══════════════════════════════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════════════════════════════ */
.page-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.page-header h1, .page-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--blue-dark);   /* dunkel auf weißem/hellgrauem Hintergrund */
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}
.page-header h1 i, .page-header h2 i { color: var(--blue); font-size: 17px; }

/* ══════════════════════════════════════════════════════════════════════════
   KARTEN
══════════════════════════════════════════════════════════════════════════ */
.datev-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
}

/* Karten-Kopfzeile: dunkler Hintergrund → heller Text */
.datev-card-header {
    background: var(--blue-dark);
    padding: 11px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
/* ALLES im card-header ist weiß – Titel, Icons, Text-Nodes */
.datev-card-header,
.datev-card-header *:not(.badge) {
    color: var(--text-light) !important;
}

.datev-card-header h3,
.datev-card-header h4,
.datev-card-header .card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
}
.datev-card-body { padding: 18px; color: var(--text); }

/* UIKit uk-card-default */
.uk-card-default {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border-radius: 8px;
    color: var(--text);
}
.uk-card-header {
    background: var(--blue-dark);
    border-radius: 8px 8px 0 0;
    padding: 11px 20px;
    border-bottom: none;
}
/* Alles im uk-card-header weiß */
.uk-card-header,
.uk-card-header *:not(.badge) {
    color: var(--text-light) !important;
}
.uk-card-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    margin: 0 !important;
}
.uk-card-body { color: var(--text); padding: 16px 20px; }

/* ── Abschnitt-Header (Formular/Detail-Karten) ────────────────────────── */
.section-header {
    background: var(--blue-dark);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    border-radius: 6px 6px 0 0;
}
.section-header,
.section-header *:not(.badge) { color: var(--text-light) !important; }

/* form-group-section: Tab-Inhaltsbereiche
   Visibility-basiertes Ausblenden verhindert Breitenänderung beim Tab-Wechsel */
.form-group-section
{
    width: 100%;
    min-width: 0;
}
.form-group-section[hidden]
{
    display: block !important;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    pointer-events: none;
    position: absolute;
    left: -9999px;
}
/* Wrapper hält stabile Breite: alle Tabs sind relativ zum selben Container */
#employee-form {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Wrapper um alle form-sections: feste Breite verankern */
.form-sections-wrapper {
    width: 100%;
    min-width: 0;
}

.form-section
{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: visible;
    /* Breite niemals vom Inhalt getrieben – immer 100% des Containers */
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: block;            /* kein inline-block, kein shrink-wrap */
}
.form-section-header
{
    background: var(--blue-dark);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    /*cursor: pointer;*/
    user-select: none;
    transition: background .14s;
    width: 100%;
    box-sizing: border-box;
    /* Verhindert Breiten-Shrink wenn body ausgeblendet */
    min-width: 0;
}
.form-section-header,
.form-section-header *:not(.badge)
{
	color: var(--text-light) !important;
}
/*
.form-section-header:hover
{
	background: var(--blue);
}
*/

/* Body: Breite fix, Autocomplete-Listen dürfen überlaufen */
.form-section-body {
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}
/* uk-grid: darf nie über Container-Breite hinauswachsen */
.form-section .uk-grid,
.form-section [uk-grid]
{
    flex-wrap: wrap;
    min-width: 0;
    box-sizing: border-box;
}
.form-section .uk-grid > *,
.form-section [uk-grid] > * {
    min-width: 0;
    box-sizing: border-box;
}

/* Formular-Labels */
label, .uk-form-label, .form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted) !important;  /* dunkelgrau auf weiß */
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 4px;
    display: block;
}

/* Eingabefelder */
.uk-input, .uk-select, .uk-textarea
{
    border-color: var(--border);
    border-radius: 5px;
    font-size: 13px;
    color: var(--text);        /* dunkel auf weiß */
    background-color: var(--surface);
}
.uk-input:focus, .uk-select:focus, .uk-textarea:focus
{
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(0,120,212,.12);
    outline: none;
}
.uk-input::placeholder
{
	color: #9CA3AF !important;
}

.uk-input:disabled, .uk-select:disabled, .uk-textarea:disabled
{
    background-color: #f8f8f8;
    color: #999;
    border-color: #e5e5e5;
}

.uk-input.uk-form-danger,
.uk-select.uk-form-danger,
.uk-textarea.uk-form-danger,
.datev-ac-input.uk-form-danger
{
    border-color: #DC2626 !important;
    background: #FEF2F2;
    box-shadow: 0 0 0 1px rgba(220,38,38,.08);
}
.uk-input.uk-form-danger:focus,
.uk-select.uk-form-danger:focus,
.uk-textarea.uk-form-danger:focus,
.datev-ac-input.uk-form-danger:focus
{
    border-color: #B91C1C !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,.14);
}

.field-error
{
    display: block;
    margin-top: 4px;
}

/* uk-label (Badge/Tag-Komponente) → blauer Hintergrund, weißer Text */
.uk-label
{
    background: var(--blue) !important;
    color: var(--text-light) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    letter-spacing: .3px;
}
.label-reset
{
	background-color: transparent !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   STATUS-BADGES
══════════════════════════════════════════════════════════════════════════ */
.badge
{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
    white-space: nowrap;
}
/* Alle Badges: dunkler Text auf pastellem Hintergrund – gut lesbar */
.badge-synced      { background: #D1FAE5; color: #065F46; }
.badge-pending     { background: #FEF3C7; color: #78350F; }
.badge-error       { background: #FEE2E2; color: #7F1D1D; }
.badge-conflict    { background: #EDE9FE; color: #3730A3; }
.badge-processing  { background: #DBEAFE; color: #1E3A8A; }
.badge-completed   { background: #D1FAE5; color: #065F46; }
.badge-failed      { background: #FEE2E2; color: #7F1D1D; }
.badge-paused      { background: #F3F4F6; color: #374151; }
.badge-retrying    { background: #FEF9C3; color: #713F12; }
.badge-dead_letter { background: #FCE7F3; color: #701A75; }

/* ══════════════════════════════════════════════════════════════════════════
   TABELLEN
══════════════════════════════════════════════════════════════════════════ */
.datev-table {
    width: 100%;
    border-collapse: collapse;
}
/* Tabellenkopf: dunkler Hintergrund → heller Text */
.datev-table thead th {
    background: var(--blue-dark);
    color: var(--text-light) !important;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 10px 14px;
    white-space: nowrap;
    border: none;
}
.datev-table thead th:first-child { border-radius: 6px 0 0 0; }
.datev-table thead th:last-child  { border-radius: 0 6px 0 0; }

.datev-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.datev-table tbody tr:hover { background: #EEF4FF; }
.datev-table tbody tr:last-child { border-bottom: none; }
.datev-table td {
    padding: 10px 14px;
    font-size: 13px;
    vertical-align: middle;
    color: var(--text);       /* dunkel auf hellem Tabellenhintergrund */
}
.datev-table a { color: var(--blue); }
.datev-table a:hover { color: var(--blue-dark); }

/* UIKit-Tabellen ebenfalls korrigieren */
.uk-table thead th {
    color: var(--text-muted) !important;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: #F3F6FA;
    border-bottom: 2px solid var(--border);
}
.uk-table td, .uk-table th { color: var(--text) !important; }

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD STAT-KARTEN
══════════════════════════════════════════════════════════════════════════ */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,62,110,.1); }
.stat-icon  { color: var(--blue); font-size: 22px; margin-bottom: 10px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--blue-dark); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-sub   { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

.status-dot
{
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.status-dot.dot-synced
{
	background-color: #16A34A;
}

.status-dot.dot-error
{
	background-color: #c30f0f;
}

/* datev-stat (alte Klasse, Kompatibilität) */
.datev-stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 18px; display: flex; align-items: center; gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: transform .15s;
}
.datev-stat:hover { transform: translateY(-2px); }
.datev-stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.datev-stat-icon.blue   { background: #EAF2FA; color: var(--blue); }
.datev-stat-icon.green  { background: #D1FAE5; color: #065F46; }
.datev-stat-icon.orange { background: #FEF3C7; color: var(--orange); }
.datev-stat-icon.red    { background: #FEE2E2; color: var(--red); }
.datev-stat-value { font-size: 26px; font-weight: 700; color: var(--blue-dark); line-height: 1; }
.datev-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════════════ */
.uk-button
{
	border-radius: 5px !important;
	font-size: 13px !important;
	font-weight: 500 !important;
}
.uk-button-primary
{
    background: var(--blue) !important;
	border-color: var(--blue) !important;
    color: var(--text-light) !important;
}
.uk-button-primary:hover
{
    background: var(--blue-dark) !important;
	border-color: var(--blue-dark) !important;
    color: var(--text-light) !important;
}
.uk-button-default
{
    background: var(--surface) !important;
	border: 1px solid var(--border) !important;
    color: var(--text) !important;
}
.uk-button-default:hover
{
	background: #F3F6FA !important;
	color: var(--blue-dark) !important;
}
.uk-button-danger
{
    background: var(--red) !important;
	border-color: var(--red) !important;
    color: var(--text-light) !important;
}
.uk-button-small
{
	font-size: 12px !important;
}
.btn-remove-row
{
	display: block;
	height: 35px;
    min-height: 35px;
	padding: 0 10px;
	background-color: #ededed;
	border: 1px solid var(--border) !important;
	border-radius: 5px;
	color: var(--red) !important;
	cursor: pointer;
	font-size: 16px;
}
.btn-remove-row:hover
{
	background-color: #dddddd;
}

/* ══════════════════════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════════════════════ */
.uk-alert { border-radius: 6px; border-left: 4px solid transparent; }
.uk-alert p, .uk-alert { color: var(--text) !important; }
.uk-alert-danger  { background: #FEF2F2 !important; border-left-color: var(--red) !important; color: #7F1D1D !important; }
.uk-alert-success { background: #F0FDF4 !important; border-left-color: #16A34A !important; color: var(--green-dark) !important; }
.uk-alert-warning { background: #FFFBEB !important; border-left-color: #D97706 !important; color: #78350F !important; }
.uk-alert-primary { background: #EFF6FF !important; border-left-color: var(--blue-accent) !important; color: #1E3A8A !important; }
.uk-alert-danger p, .uk-alert-danger  { color: #7F1D1D !important; }
.uk-alert-success p, .uk-alert-success{ color: var(--green-dark) !important; }
.uk-alert-warning p, .uk-alert-warning{ color: #78350F !important; }
.uk-alert-primary p, .uk-alert-primary{ color: #1E3A8A !important; }

/* ══════════════════════════════════════════════════════════════════════════
   JOB-MONITOR
══════════════════════════════════════════════════════════════════════════ */
.job-row-failed     { background: #FFF5F5 !important; }
.job-row-completed  { background: #F0FFF4 !important; }
.job-row-processing { background: #EFF6FF !important; }

/* ══════════════════════════════════════════════════════════════════════════
   LOG-VIEWER
══════════════════════════════════════════════════════════════════════════ */
.log-entry { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; overflow: hidden; }
.log-entry-header {
    padding: 8px 12px; background: #F3F6FA; cursor: pointer;
    display: flex; align-items: center; gap: 10px; font-size: 12px;
    color: var(--text); transition: background .1s;
}
.log-entry-header:hover { background: #E5ECF6; }
.log-body {
    background: #1A1E2A; color: #CDD5E0; padding: 12px;
    font-family: 'Consolas','Courier New',monospace; font-size: 12px;
    max-height: 300px; overflow-y: auto; white-space: pre-wrap;
    word-break: break-all; display: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   CODE
══════════════════════════════════════════════════════════════════════════ */
code {
    background: #F1F5F9; color: var(--blue-dark);
    padding: 1px 6px; border-radius: 4px; font-size: 12px;
    border: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════════════════
   TEXT-HILFSKLASSEN
══════════════════════════════════════════════════════════════════════════ */
.uk-text-muted { color: var(--text-muted) !important; }
.uk-text-success
{
    color: #27ae32 !important;
}
h1,h2,h3,h4,h5 { color: var(--text); }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

/* ══════════════════════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════════════════════ */
.uk-pagination > * > * {
    color: var(--text) !important; border: 1px solid var(--border);
    border-radius: 5px; padding: 5px 10px; font-size: 13px;
}
.uk-pagination > .uk-active > * { background: var(--blue); color: var(--text-light) !important; border-color: var(--blue); }
.uk-pagination > * > *:hover    { background: var(--blue-light); color: var(--blue-dark) !important; }

/* ══════════════════════════════════════════════════════════════════════════
   ANIMATIONEN
══════════════════════════════════════════════════════════════════════════ */
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.3} }
.pulse { animation: pulse-dot 2s infinite; }
@keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
.spin  { animation: spin 1s linear infinite; }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 959px) {
    .topbar-nav, .api-status-badge, .user-menu-name { display: none; }
}
@media (max-width: 639px) {
    .page-content { padding: 16px 12px 24px; }
    .page-header  { flex-direction: column; align-items: flex-start; }
    .datev-table  { font-size: 12px; }
    .datev-table td, .datev-table th { padding: 8px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN-SEITE
══════════════════════════════════════════════════════════════════════════ */
body.login-page {
    background: linear-gradient(145deg, #001F40 0%, #003F6E 60%, #005A9C 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-main {
    width: 100%; padding: 20px;
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-card {
    background: var(--surface); border-radius: 12px; padding: 40px;
    box-shadow: 0 24px 64px rgba(0,0,0,.4); width: 100%; max-width: 420px;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo i  { font-size: 40px; color: var(--blue); }
.login-logo h1 { font-size: 22px; color: var(--blue-dark); margin: 12px 0 4px; font-weight: 700; }
.login-logo p  { color: #6B7280; font-size: 13px; margin: 0; }

.field-label {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; display: block;
}
.btn-login {
    background: var(--blue) !important; border-color: var(--blue) !important;
    color: var(--text-light) !important; border-radius: 6px !important;
    width: 100%; font-weight: 600 !important;
}
.btn-login:hover { background: var(--blue-dark) !important; }
.login-footer { text-align: center; margin-top: 24px; font-size: 12px; color: #9CA3AF; }
.pwd-eye { font-size: 14px; color: #9CA3AF; }
.login-alert { font-size: 13px; padding: 10px 14px; margin-bottom: 20px; }

/* ── UIKit-Overrides (spezifische Selektoren) ────────────────────────────── */
/* UIKit setzt border-bottom auf card-header, wir entfernen es */
.uk-card-default > .uk-card-header {
    border-bottom: none;
}
/* uk-card-header Flex für Icon + Titel */
.uk-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
/* uk-card-header direkte Kind-Elemente erben Farbe */
.uk-card-header > *, .uk-card-header span, .uk-card-header i {
    color: var(--text-light) !important;
}

/* Sicherstellen: Tabellentext in datev-card-body */
.datev-card-body td,
.datev-card-body th,
.datev-card-body span:not(.badge),
.datev-card-body p {
    color: var(--text);
}

/* Beschriftungen in Detail-Karten */
.uk-card-body .uk-text-muted,
.datev-card-body .uk-text-muted {
    color: var(--text-muted) !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   FIELD-TOOLTIPS – direkt am label[data-tip]
══════════════════════════════════════════════════════════════════════════ */

/* Labels mit Tooltip zeigen Fragezeichen-Cursor */
label[data-tip],
.field-label-show[data-tip]
{
    cursor: help;
    text-decoration: none;
}

/* Feldbezeichner in Detailansicht (show.php) */
.field-label-show {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    cursor: default;
    border-bottom: 1px dotted transparent;
    transition: border-color .12s, color .12s;
}

/* Tooltip-Bubble (per JS) */
#field-tooltip {
    position: fixed;
    z-index: 9999;
    background: #1E293B;
    color: #E2E8F0;
    font-size: 12px;
    line-height: 1.55;
    padding: 10px 14px;
    border-radius: 7px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    max-width: 320px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s;
    border: 1px solid rgba(255,255,255,.08);
}
#field-tooltip.is-visible { opacity: 1; }
#field-tooltip strong { color: #93C5FD; display: block; margin-bottom: 4px; }
#field-tooltip em { color: #86EFAC; font-style: normal; }
#field-tooltip .tip-values {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,.12);
}
#field-tooltip .tip-values span { display: block; margin-bottom: 2px; }

/* ── Autocomplete-Dropdown ──────────────────────────────────────────────── */
.datev-ac-wrap { position: relative; }
.datev-ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--surface);
    border: 1px solid var(--blue);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 240px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.datev-ac-dropdown li {
    padding: 7px 11px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.datev-ac-dropdown li:last-child { border-bottom: none; }
.datev-ac-dropdown li:hover,
.datev-ac-dropdown li.is-active { background: var(--blue-light); color: var(--blue-dark); }
.datev-ac-dropdown .ac-code {
    display: inline-block;
    width: 36px;
    font-style: normal;
    font-weight: 700;
    color: var(--blue);
    font-size: 11px;
}

/* ══════════════════════════════════════════════════════════════════════════
   FORMULAR-TAB-NAVIGATION (ersetzt uk-subnav-pill – kein UIKit-Hijack)
══════════════════════════════════════════════════════════════════════════ */
.datev-tab-nav
{
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.datev-tab-nav li a
{
    display: inline-block;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
	text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background .12s, color .12s, border-color .12s;
    white-space: nowrap;
    cursor: pointer;
}
.datev-tab-nav li a:hover
{
    background: var(--blue-light);
    color: var(--blue-dark);
    border-color: var(--blue-accent);
    text-decoration: none;
}
.datev-tab-nav li.uk-active a,
.datev-tab-nav li.is-active a
{
    background-color: var(--blue-accent);
    color: #fff;
    border-color: var(--blue-accent);
    font-weight: 500;
}
.datev-tab-nav li.has-errors a
{
    border-color: #DC2626;
    color: #991B1B;
    background: #FEF2F2;
}
.datev-tab-nav li.has-errors a:hover
{
    border-color: #B91C1C;
    color: #7F1D1D;
    background: #FEE2E2;
}
.datev-tab-nav li.has-errors.uk-active a,
.datev-tab-nav li.has-errors.is-active a
{
    background: #DC2626;
    border-color: #DC2626;
    color: #fff;
}

/* Boolean-Selects (Ja/Nein) – gleiche Höhe wie uk-input */
select.uk-select, .uk-select:not([multiple]):not([size])
{
    height: 35px;
    min-height: 35px;
    line-height: 1.5;
}
/* Konsistente Input-Höhe für alle Formularelemente */
.uk-input, .uk-select, .uk-textarea,
.uk-form-small:is(.uk-input,.uk-search-input,.uk-select:not([multiple]):not([size]))
{
    height: 35px;
}
.uk-textarea { height: auto; min-height: 80px; }


/* ══════════════════════════════════════════════════════════════════════════
   DATEV AUTOCOMPLETE-WIDGET
══════════════════════════════════════════════════════════════════════════ */
.datev-ac-wrap { position: relative; }
.datev-ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    list-style: none;
    margin: 2px 0 0;
    padding: 4px 0;
    max-height: 260px;
    overflow-y: auto;
}
.datev-ac-item {
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
    transition: background .08s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.datev-ac-item:hover,
.datev-ac-item.is-selected {
    background: var(--blue-light);
    color: var(--blue-dark);
}
.datev-ac-code {
    display: inline-block;
    font-style: normal;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 28px;
    margin-right: 6px;
    font-family: monospace;
}
