:root {
    --bg: #eef1f5;
    --bg-soft: #f8fafc;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-solid: #ffffff;
    --text: #17202f;
    --muted: #667085;
    --muted-2: #8b95a5;
    --line: rgba(148, 163, 184, 0.28);
    --line-strong: rgba(100, 116, 139, 0.24);
    --dark: #101623;
    --dark-2: #1c2433;
    --dark-3: #2c3548;
    --accent: #344256;
    --accent-soft: #e7ebf2;
    --danger: #a33434;
    --success: #237447;
    --warning: #916317;
    --focus: rgba(63, 76, 100, 0.18);
    --shadow: 0 24px 70px rgba(17, 24, 39, 0.10);
    --shadow-soft: 0 14px 38px rgba(17, 24, 39, 0.07);
    --radius: 22px;
    --radius-small: 14px;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.96) 0, rgba(255, 255, 255, 0.35) 24%, transparent 46%),
        radial-gradient(circle at 90% 4%, rgba(181, 190, 205, 0.45) 0, rgba(181, 190, 205, 0.16) 28%, transparent 52%),
        linear-gradient(135deg, #f8fafc 0%, #eef1f5 44%, #e4e8ef 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 70%);
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

a:hover {
    text-decoration: underline;
}

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

.sidebar {
    width: 304px;
    padding: 28px 18px;
    color: #fff;
    background:
        linear-gradient(160deg, rgba(16, 22, 35, 0.98) 0%, rgba(27, 35, 50, 0.98) 56%, rgba(46, 55, 73, 0.98) 100%);
    position: sticky;
    top: 0;
    min-height: 100vh;
    box-shadow: 24px 0 60px rgba(17, 24, 39, 0.18);
    overflow: hidden;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: -80px -120px auto auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    filter: blur(6px);
}

.brand {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 0 10px 28px;
}

.brand-icon,
.login-logo,
.footer-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.20), rgba(255,255,255,0.06));
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.14),
        0 14px 30px rgba(0,0,0,0.18);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-title {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.brand-subtitle {
    margin-top: 2px;
    font-size: 13px;
    color: rgba(255,255,255,0.68);
}

.nav {
    position: relative;
    display: grid;
    gap: 7px;
}

.nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    color: rgba(255,255,255,0.78);
    border-radius: 14px;
    text-decoration: none;
    transition: transform .16s ease, background .16s ease, color .16s ease;
    border: 1px solid transparent;
}

.nav a::after {
    content: "›";
    opacity: 0;
    transform: translateX(-4px);
    transition: .16s ease;
}

.nav a:hover,
.nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.12);
    transform: translateX(2px);
}

.nav a:hover::after,
.nav a.active::after {
    opacity: .75;
    transform: translateX(0);
}

.logout-form {
    position: relative;
    margin-top: 30px;
    padding: 0 10px;
}

.sidebar-credit {
    position: relative;
    margin: 22px 10px 0;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.72);
    font-size: 12px;
    line-height: 1.4;
}

.sidebar-credit span {
    display: block;
    margin-bottom: 4px;
}

.sidebar-credit a {
    color: #fff;
    font-weight: 850;
}

.main {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 38px;
}

.login-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 28px;
}

.login-card {
    width: min(470px, 100%);
    padding: 36px;
    border-radius: 30px;
    background: rgba(255,255,255,0.88);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.82);
    backdrop-filter: blur(18px);
}

.login-logo {
    margin-bottom: 18px;
    background: linear-gradient(145deg, #111827, #374151);
    color: #fff;
}

h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

h2 {
    margin: 0 0 14px;
    font-size: 21px;
    letter-spacing: -0.025em;
}

h3 {
    letter-spacing: -0.02em;
}

p {
    line-height: 1.6;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 26px;
    padding: 6px 2px 0;
}

.page-head p,
.muted,
.hint,
.hint-box {
    color: var(--muted);
}

.head-actions,
.action-list.horizontal {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.grid-1 {
    display: grid;
    gap: 18px;
}

.card,
.alert-panel {
    position: relative;
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 18px;
    backdrop-filter: blur(18px);
}

.card::before,
.alert-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.metric {
    min-height: 164px;
    overflow: hidden;
}

.metric::after {
    content: "";
    position: absolute;
    right: -44px;
    top: -54px;
    width: 140px;
    height: 140px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
}

.metric-label,
.metric span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 700;
}

.metric strong {
    display: block;
    font-size: 29px;
    line-height: 1.12;
    letter-spacing: -0.04em;
    overflow-wrap: anywhere;
}

.metric small {
    display: block;
    margin-top: 13px;
    color: var(--muted);
}

.details {
    display: grid;
    grid-template-columns: 175px 1fr;
    gap: 11px 16px;
    margin: 0;
}

.details dt {
    color: var(--muted);
    font-weight: 700;
}

.details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.form {
    display: grid;
    gap: 14px;
}

.form.wide {
    gap: 0;
}

label {
    display: block;
    margin-bottom: 7px;
    color: #303a4c;
    font-weight: 760;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    color: var(--text);
    background: rgba(255,255,255,0.92);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(52, 66, 86, 0.55);
    box-shadow: 0 0 0 5px var(--focus);
    background: #fff;
}

input[readonly] {
    background: #f8fafc;
    color: #475467;
}

.switch-row {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

.check input {
    width: auto;
    accent-color: #344256;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 12px 17px;
    font-weight: 850;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease, background .14s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #111827, #303a4c);
    color: #fff;
    box-shadow: 0 14px 28px rgba(17, 24, 39, 0.22);
}

.btn-secondary {
    background: linear-gradient(135deg, #eef2f7, #dfe5ee);
    color: #1e2632;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.btn-light {
    background: rgba(255,255,255,.13);
    color: inherit;
    border: 1px solid rgba(130,140,155,0.28);
}

.sidebar .btn-light {
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #a33434, #7d1f1f);
    color: #fff;
}

.btn-small {
    padding: 8px 11px;
    font-size: 13px;
    border-radius: 11px;
}

.btn-full {
    width: 100%;
}

.action-list {
    display: grid;
    gap: 12px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.logbox {
    margin: 0;
    padding: 17px;
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.06), transparent 36%),
        #111827;
    color: #dbe3ef;
    min-height: 220px;
    max-height: 460px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.65;
    border: 1px solid rgba(255,255,255,0.08);
}

.logbox.large {
    min-height: 620px;
}

.flash-wrap {
    margin-bottom: 18px;
}

.flash {
    padding: 15px 17px;
    border-radius: 16px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-soft);
    font-weight: 650;
}

.flash-success {
    background: #e8f6ee;
    color: #155b34;
    border-color: #bfe6ce;
}

.flash-danger {
    background: #fdecec;
    color: #7d1f1f;
    border-color: #f5c0c0;
}

.flash-warning {
    background: #fff5df;
    color: #7a4c0e;
    border-color: #f0d394;
}

.flash-info {
    background: #edf2fb;
    color: #2b4369;
    border-color: #cad8f0;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.72);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

th,
td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: rgba(241, 245, 249, 0.88);
    color: #4c5564;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .055em;
}

tr:hover td {
    background: rgba(248, 250, 252, 0.62);
}

td code,
.hint-box code,
details code {
    font-size: 12px;
    color: #394253;
    word-break: break-all;
}

.right {
    text-align: right;
}

.inline-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form input {
    width: 130px;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 18px;
    margin: 0 -18px;
    background: rgba(238, 241, 245, 0.76);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(220,224,230,0.86);
}

.hint-box {
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.86);
    margin: 12px 0;
    overflow-wrap: anywhere;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    margin-left: 6px;
}

.badge-ok {
    background: #e8f6ee;
    color: #155b34;
}

.badge-bad {
    background: #fdecec;
    color: #7d1f1f;
}

.badge-neutral {
    background: #eef0f3;
    color: #4c5564;
}

.alert-panel {
    border-color: rgba(240, 195, 108, 0.65);
    background: linear-gradient(135deg, rgba(255, 249, 235, 0.96) 0%, rgba(255,255,255,0.92) 74%);
}

.alert-panel h2 {
    color: #7a4c0e;
}

.alert-list,
.problem-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.alert-item,
.problem-item {
    display: grid;
    gap: 6px;
    padding: 15px 17px;
    border-radius: 16px;
    background: rgba(255,255,255,0.88);
    border: 1px solid #efd59a;
}

.alert-item strong,
.problem-item strong {
    color: #7a4c0e;
    letter-spacing: .02em;
}

.alert-item span,
.alert-item small,
.problem-item span,
.problem-item small {
    overflow-wrap: anywhere;
}

.alert-item small,
.problem-item small {
    color: var(--muted);
}

.recipient-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.recipient-tile {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 15px;
    background: rgba(255,255,255,0.88);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.56);
}

.recipient-tile input {
    width: auto;
    margin-top: 3px;
}

.recipient-tile small {
    display: block;
    color: var(--muted);
    word-break: break-all;
}

.recipient-tile.disabled {
    opacity: .55;
    background: #f4f5f7;
}

.actions-cell {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.inline-action {
    display: inline-flex;
}

.standalone {
    margin-top: 13px;
}

.horizontal {
    display: flex !important;
    flex-wrap: wrap;
}

.footer {
    padding: 28px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.footer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(255,255,255,0.78);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.footer-card-login {
    width: min(720px, 100%);
    background: rgba(255,255,255,0.78);
}

.footer-mark {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(145deg, #111827, #3c4659);
    box-shadow: 0 14px 30px rgba(17, 24, 39, 0.18);
}

.footer-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.footer-copy span {
    color: var(--muted);
}

.footer-copy strong {
    color: var(--text);
    font-size: 14px;
}

.footer-copy a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.footer-website {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    text-decoration: none !important;
    font-size: 12px;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
}

.footer-website:hover {
    opacity: .92;
}

@media (max-width: 1120px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .recipient-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 880px) {
    .layout {
        display: block;
    }

    .sidebar {
        width: auto;
        min-height: auto;
        position: relative;
        border-radius: 0 0 28px 28px;
    }

    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar-credit {
        margin-bottom: 4px;
    }

    .main {
        padding: 24px;
    }

    .page-head {
        display: block;
    }

    .head-actions {
        margin-top: 16px;
    }

    .cards,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .details {
        grid-template-columns: 1fr;
    }

    .footer-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 620px) {
    .recipient-grid {
        grid-template-columns: 1fr;
    }

    .actions-cell {
        display: table-cell;
    }

    .footer-card {
        display: grid;
        grid-template-columns: auto 1fr;
    }

    .footer-website {
        grid-column: 1 / -1;
        text-align: center;
    }
}

@media (max-width: 540px) {
    .nav {
        grid-template-columns: 1fr;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .card,
    .login-card {
        padding: 19px;
    }

    .main {
        padding: 17px;
    }

    .login-main {
        padding: 17px;
    }

    h1 {
        font-size: 31px;
    }
}

/* Mehrsprachiger Adminbereich */
.language-switcher {
    position: relative;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.language-switcher-sidebar {
    margin: 0 10px 22px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.12);
}

.language-switcher-login {
    width: min(470px, 100%);
    justify-content: center;
    padding: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.74);
    border: 1px solid rgba(255,255,255,0.86);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.language-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 999px;
    color: rgba(255,255,255,0.82);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.11);
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    transition: transform .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
}

.language-switcher-login .language-option {
    color: #273244;
    background: rgba(255,255,255,0.86);
    border-color: rgba(148, 163, 184, 0.26);
}

.language-option:hover,
.language-option.active {
    transform: translateY(-1px);
    color: #fff;
    background: rgba(255,255,255,0.19);
    box-shadow: 0 12px 26px rgba(0,0,0,0.13);
}

.language-switcher-login .language-option:hover,
.language-switcher-login .language-option.active {
    color: #fff;
    background: linear-gradient(135deg, #111827, #303a4c);
}

.language-flag {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    font-size: 18px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.language-switcher-login .language-flag {
    background: rgba(17, 24, 39, 0.06);
}

.language-name {
    display: inline;
}

.language-short {
    display: none;
}

@media (max-width: 1120px) {
    .language-name {
        display: none;
    }

    .language-short {
        display: inline;
    }
}

@media (max-width: 880px) {
    .language-switcher-sidebar {
        margin-bottom: 18px;
    }

    .language-name {
        display: inline;
    }

    .language-short {
        display: none;
    }
}

@media (max-width: 540px) {
    .language-switcher-login {
        border-radius: 22px;
    }

    .language-option {
        flex: 1 1 auto;
    }

    .language-name {
        display: none;
    }

    .language-short {
        display: inline;
    }
}

/* Bessere Mailkonto-/SMTP-Formulare */
.form-error-summary {
    border-color: rgba(163, 52, 52, 0.34);
    background: linear-gradient(135deg, rgba(253, 236, 236, 0.96), rgba(255,255,255,0.92));
}

.form-error-summary h2 {
    color: var(--danger);
}

.form-error-summary ul {
    margin: 8px 0 0;
    padding-left: 20px;
    line-height: 1.7;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea,
.card.has-error .recipient-grid {
    border-color: rgba(163, 52, 52, 0.62);
    box-shadow: 0 0 0 4px rgba(163, 52, 52, 0.08);
}

.field-error {
    display: block;
    margin-top: 7px;
    color: var(--danger);
    font-weight: 800;
    line-height: 1.35;
}

.setup-helper {
    border-color: rgba(35, 116, 71, 0.22);
    background: linear-gradient(135deg, rgba(232, 246, 238, 0.78), rgba(255,255,255,0.92));
}

.helper-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0 8px;
}

.security-options {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.86);
}

.security-options > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.pop3-preserve-box {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.86), rgba(255, 255, 255, 0.94));
}

.pop3-preserve-box .hint {
    margin-top: 8px;
}
