* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #172033;
    --text-soft: #7a8498;
    --border: #e5e9f1;

    --primary: #0085CB;
    --primary-dark: #006BA1;
    --primary-light: #EBF5FB;

    --success: #179c65;
    --success-bg: #ecfbf4;

    --error: #d1435b;
    --error-bg: #fdecef;

    --sidebar-bg: #10182c;
    --sidebar-width: 264px;
}

body {
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.logo-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #30c98b;
    box-shadow: 0 0 0 5px rgba(48, 201, 139, .15), 0 0 14px rgba(48, 201, 139, .55);
    flex: 0 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: "Outfit", "Open Sans", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    text-decoration: none;
}

/* ==================================================================
   EINGELOGGTER BEREICH: SCHLANKE SIDEBAR (Desktop) / TOPBAR (Mobile)
   ================================================================== */

body.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 50;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 22px;
}

.sidebar .brand { color: white; }

.sidebar-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 4px 22px 22px;
}

.sidebar-sender {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 13px;
    background: rgba(255,255,255,.08);
    border-radius: 10px;
    color: rgba(255,255,255,.85);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-nav-divider {
    height: 1px;
    margin: 8px 12px;
    background: rgba(255,255,255,.10);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 12px;
    border-radius: 10px;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 620;
    transition: background .15s ease, color .15s ease;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: rgba(255,255,255,.15);
    color: white;
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 auto;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,.06);
    color: white;
}

.sidebar-nav a.active {
    background: rgba(255,255,255,.12);
    color: white;
}

.sidebar-nav a.logout {
    color: #ff9d9d;
}

.sidebar-nav a.logout:hover {
    background: rgba(255,80,80,.10);
    color: #ffb3b3;
}

.sidebar-lang {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.sidebar-lang a {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .3px;
    color: rgba(255,255,255,.4);
    text-decoration: none;
}

.sidebar-lang a:hover,
.sidebar-lang a.active {
    color: white;
}

/* Hamburger-Button, per Default (Desktop) ausgeblendet */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.sidebar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 2px;
}

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 48px 6% 40px;
}

.main-inner {
    max-width: 870px;
    margin: 0 auto;
}

/* ==================================================================
   ÖFFENTLICHE INHALTSSEITEN OHNE LOGIN (Datenschutz, Impressum, ...)
   Bewusst kein enges Karten-Layout wie bei den Auth-Formularen - fügt
   sich stattdessen wie eine normale Inhaltsseite ins Gesamtbild ein,
   bleibt aber ohne Anmeldung erreichbar.
   ================================================================== */

body.public {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 20px 60px;
}

.public-main {
    width: 100%;
    display: flex;
    justify-content: center;
}

.public-content {
    width: 100%;
    max-width: 720px;
}

.public-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 40px;
}

.public-content .brand { color: var(--text); }
.public-content .logo-dot { background: var(--success); box-shadow: 0 0 0 5px rgba(23,156,101,.15), 0 0 14px rgba(23,156,101,.45); }

/* ==================================================================
   ÖFFENTLICHER BEREICH: ZENTRIERTE KARTE (Login, Registrierung, ...)
   ================================================================== */

body.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.auth-main {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    min-height: 600px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 40px 38px;
    box-shadow: 0 24px 60px rgba(15, 24, 45, .06);
}

.auth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 30px;
}

.auth-card .brand { color: var(--text); }
.auth-card .logo-dot { background: var(--success); box-shadow: 0 0 0 5px rgba(23,156,101,.15), 0 0 14px rgba(23,156,101,.45); }

.auth-lang {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-lang a {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--text-soft);
    text-decoration: none;
}

.auth-lang a:hover,
.auth-lang a.active {
    color: var(--primary);
}

/* ==================================================================
   GEMEINSAME SEITENELEMENTE (Titel, Footer, Formulare, Tabellen, ...)
   ================================================================== */

.page-head { margin-bottom: 24px; }

.mini-title {
    color: var(--primary);
    font-size: 11.5px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin-bottom: 10px;
}

h1 {
    font-family: "Outfit", "Open Sans", sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(24px, 2.6vw, 32px);
    line-height: 1.15;
    letter-spacing: -.2px;
    margin-bottom: 10px;
}

h2, h3 {
    font-family: "Outfit", "Open Sans", sans-serif;
    font-weight: 700;
}

.intro {
    color: var(--text-soft);
    font-size: 14.5px;
    line-height: 1.6;
    min-height: 47px; /* Platz für bis zu 2 Zeilen - hält die Kartenhöhe
                          unabhängig von der Übersetzungslänge konstant */
}

.site-footer {
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 18px;
}

.site-footer a {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
}

.site-footer a:hover { color: var(--primary); }

/* -------------------------------------------------- FORMULAR */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #596275;
}

.input-wrap { position: relative; }

input, textarea, select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: white;
    padding: 15px 16px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

input, select { height: 55px; }

select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%237a8498' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

input[readonly], input:disabled {
    background: #f2f4f9;
    color: var(--text-soft);
}

select:focus, input:focus, textarea:focus {
    border-color: rgba(0, 133, 203, .7);
    box-shadow: 0 0 0 4px rgba(0, 133, 203, .08);
}

textarea {
    height: 155px;
    resize: none;
    line-height: 1.55;
    padding-bottom: 40px;
}

input::placeholder, textarea::placeholder { color: #abb2c1; }

.counter {
    position: absolute;
    right: 14px;
    bottom: 13px;
    font-size: 11px;
    font-weight: 650;
    color: #9ba3b2;
    background: white;
    padding-left: 8px;
}

/* -------------------------------------------------- PASSWORT SICHTBAR/UNSICHTBAR */

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    border-radius: 9px;
    cursor: pointer;
    color: var(--text-soft);
    transition: color .15s ease, background .15s ease;
}

.password-toggle:hover {
    color: var(--text);
    background: #f2f4f9;
}

.password-toggle svg {
    width: 19px;
    height: 19px;
}

.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }

.field-hint {
    margin-top: 7px;
    font-size: 12px;
    color: var(--text-soft);
}

.field-error {
    margin-top: 7px;
    font-size: 12px;
    color: var(--error);
    font-weight: 600;
}

/* -------------------------------------------------- CHECKBOXEN (Pflichtbestätigungen) */

.consent-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.consent-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: 0 0 auto;
    accent-color: var(--primary);
    cursor: pointer;
}

.consent-row label {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
    cursor: pointer;
}

.consent-row a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}

/* -------------------------------------------------- BUTTON */

.send-button {
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 15px;
    background: var(--primary);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
    box-shadow: 0 14px 35px rgba(0, 133, 203, .16);
    text-decoration: none;
}

.send-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 17px 38px rgba(0, 133, 203, .22);
}

.send-button:active { transform: translateY(0); }

.send-button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-button svg { width: 17px; height: 17px; }

.send-button.secondary {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
    box-shadow: none;
}

.send-button.secondary:hover { background: var(--primary-light); }

.send-button.danger {
    background: white;
    color: var(--error);
    border: 1px solid rgba(209,67,91,.3);
    box-shadow: none;
}

.send-button.danger:hover { background: var(--error-bg); }

/* -------------------------------------------------- MELDUNGEN */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 22px;
    padding: 17px 18px;
    border-radius: 15px;
    animation: slideIn .35s ease;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(23,156,101,.14);
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid rgba(209,67,91,.16);
}

.alert-icon {
    flex: 0 0 auto;
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    font-size: 15px;
    font-weight: bold;
}

.alert-success .alert-icon { background: var(--success); }
.alert-error .alert-icon { background: var(--error); }

.alert-text strong {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
}

.alert-success .alert-text strong { color: #116c49; }
.alert-error .alert-text strong { color: #96263c; }

.alert-text p {
    font-size: 12px;
    line-height: 1.5;
    color: #55937a;
}

.alert-error .alert-text p { color: #a24a5c; }

.form-footer-links {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.form-footer-links a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

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

.form-footer-links .muted {
    color: var(--text-soft);
    font-weight: 500;
}

/* -------------------------------------------------- ACCOUNT-BEREICH */

.account-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 20px;
    background: white;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.account-row:last-child { border-bottom: none; }

.account-row .label { color: var(--text-soft); font-weight: 600; }
.account-row .value { font-weight: 650; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success { background: var(--success-bg); color: #116c49; }
.badge-warning { background: #fff6e5; color: #93650a; }
.badge-error { background: var(--error-bg); color: #96263c; }
.badge-neutral { background: #f2f4f9; color: var(--text-soft); }

.account-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.account-actions .send-button { width: auto; padding: 0 22px; height: 46px; font-size: 13px; }

.danger-zone {
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.danger-zone h2 {
    font-size: 15px;
    margin-bottom: 6px;
}

.danger-zone p {
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.55;
    margin-bottom: 16px;
    max-width: 480px;
}

/* -------------------------------------------------- DRAG & DROP UPLOAD (Lizenzurkunde) */

.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    background: #fafbfd;
    transition: border-color .15s ease, background .15s ease;
}

.upload-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-dropzone-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 36px 20px;
    cursor: pointer;
    text-align: center;
}

.upload-dropzone-text {
    font-size: 14px;
    font-weight: 650;
    color: var(--text);
}

.upload-dropzone-hint {
    font-size: 12px;
    color: var(--text-soft);
}

/* -------------------------------------------------- LISTEN-TOOLBAR (Filter, Suche) */

.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 20px;
}

.list-toolbar .form-group { margin-bottom: 0; flex: 1 1 160px; }

.list-toolbar .send-button.secondary {
    width: auto;
    height: 55px;
    padding: 0 20px;
}

/* -------------------------------------------------- DATENTABELLE (Historie, Kontakte) */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 13px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #fafbfd;
    color: var(--text-soft);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: .6px;
}

.data-table tr:last-child td { border-bottom: none; }

.table-actions {
    display: flex;
    gap: 14px;
}

.table-action-btn {
    border: 0;
    background: transparent;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 4px;
    font-family: inherit;
    text-decoration: none;
}

.table-action-btn.edit { color: var(--primary); }
.table-action-btn.delete { color: var(--error); }
.table-action-btn:hover { text-decoration: underline; }

/* -------------------------------------------------- VERIFIZIERUNGEN: Freischalten/Ablehnen-Zeile */

.verify-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.verify-reject-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.verify-btn {
    height: 34px;
    padding: 0 14px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: white;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease;
}

.verify-btn.approve { color: var(--success); }
.verify-btn.approve:hover { background: var(--success-bg); border-color: rgba(23,156,101,.35); }

.verify-btn.reject { color: var(--error); }
.verify-btn.reject:hover { background: var(--error-bg); border-color: rgba(209,67,91,.35); }

.verify-reason-select {
    height: 34px;
    width: 128px;
    padding: 0 26px 0 10px;
    font-size: 12px;
    border-radius: 9px;
    background-position: right 8px center;
    text-overflow: ellipsis;
}

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
}

.status-pill.sent { background: var(--success-bg); color: #116c49; }
.status-pill.failed { background: var(--error-bg); color: #96263c; }

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-soft);
    font-size: 14px;
}

/* -------------------------------------------------- PAGINATION */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 12.5px;
    color: var(--text-soft);
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-links a,
.pagination-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
}

.pagination-links a:hover { border-color: var(--primary); color: var(--primary); }
.pagination-links span.current { background: var(--primary); color: white; border-color: var(--primary); }
.pagination-links span.disabled { color: #c3c9d5; cursor: not-allowed; }

/* -------------------------------------------------- AUTOCOMPLETE-DROPDOWN */

.autocomplete-wrap {
    position: relative;
}

.autocomplete-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;

    margin: 0;
    padding: 6px;
    list-style: none;

    max-height: 230px;
    overflow-y: auto;

    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 32px rgba(15, 24, 45, .12);
}

.autocomplete-list.open { display: block; }

.autocomplete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    cursor: pointer;
}

.autocomplete-item:hover { background: var(--primary-light); }

.autocomplete-item .ac-callsign { font-weight: 700; }
.autocomplete-item .ac-id { color: var(--text-soft); font-size: 12px; }

.autocomplete-empty {
    padding: 10px 12px;
    font-size: 12.5px;
    color: var(--text-soft);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==================================================================
   RESPONSIVE: Sidebar wird zur fixen Topbar mit Hamburger-Menü
   ================================================================== */

@media (max-width: 900px) {
    .main { margin-left: 0; padding: 90px 6% 50px; }

    .sidebar {
        width: 100%;
        height: 64px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        bottom: auto;
        overflow: visible;
    }

    .sidebar-top { padding: 0; flex: 1; }

    .sidebar-toggle { display: flex; }

    .sidebar-body {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--sidebar-bg);
        padding: 18px 20px 24px;
        box-shadow: 0 20px 40px rgba(0,0,0,.28);
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }

    .sidebar-body.open { display: flex; }

    .sidebar-lang { margin-top: 6px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
}

@media (max-width: 640px) {
    .main { padding-left: 5.5%; padding-right: 5.5%; }
    .auth-card { min-height: auto; padding: 32px 26px; border-radius: 18px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .account-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .data-table { display: block; overflow-x: auto; white-space: nowrap; }
    .pagination { flex-direction: column; align-items: flex-start; }
}
