:root {
    --admin-primary: #51aee2;
    --admin-primary-dark: #287fae;
    --admin-primary-soft: #eaf6fc;
    --admin-accent: #f07e26;
    --admin-accent-dark: #d96615;
    --admin-success: #23875a;
    --admin-danger: #c2414b;
    --admin-text: #172b35;
    --admin-muted: #657780;
    --admin-border: #dce6e9;
    --admin-surface: #ffffff;
    --admin-background: #f1f5f6;
    --admin-shadow: 0 18px 50px rgba(22, 52, 63, .08);
    --admin-radius: 18px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    min-height: 100vh;
    padding: 24px clamp(20px, 4vw, 64px) 64px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 100% 0, rgba(81, 174, 226, .12), transparent 31rem),
        var(--admin-background);
    color: var(--admin-text);
    font-size: 15px;
    line-height: 1.55;
}

body::before {
    content: "WUNDVERBUND GÄUBODEN     ADMINISTRATION";
    display: flex;
    max-width: 1200px;
    min-height: 58px;
    margin: 0 auto 38px;
    padding: 0 20px;
    align-items: center;
    border: 1px solid rgba(220, 230, 233, .9);
    border-radius: 14px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 8px 28px rgba(22, 52, 63, .055);
    backdrop-filter: blur(14px);
    color: var(--admin-primary-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    white-space: pre;
}

.intranet-body::before { display: none; }
.intranet-body { padding-top: clamp(28px, 5vw, 64px); }

body > h1,
body > .admin-topbar,
body > .admin-card {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    margin: 0 0 22px;
    color: #102a34;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.15;
    letter-spacing: -.035em;
}

h2, h3 { color: #17384c; }

a { color: var(--admin-primary-dark); text-underline-offset: 3px; }
a:hover { color: var(--admin-primary); }

.admin-card {
    padding: clamp(20px, 3vw, 32px);
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(220, 230, 233, .95);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
}

.admin-topbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.admin-button {
    display: inline-flex;
    min-height: 42px;
    padding: 9px 16px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--admin-accent);
    box-shadow: 0 5px 14px rgba(240, 126, 38, .18);
    color: #fff !important;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.admin-button:hover {
    background: var(--admin-accent-dark);
    box-shadow: 0 8px 20px rgba(240, 126, 38, .22);
    transform: translateY(-1px);
}

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

.admin-button.secondary {
    border-color: var(--admin-border);
    background: #fff;
    box-shadow: none;
    color: #425563 !important;
}

.admin-button.secondary:hover { background: #f4f7f9; color: #162d3c !important; }
.admin-button.success { background: var(--admin-success); }
.admin-button.danger { background: var(--admin-danger); }

.admin-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: separate;
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: 11px;
    background: var(--admin-surface);
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e8edf0;
    vertical-align: middle;
}

.admin-table th {
    background: #f5f8f9;
    color: #51626e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-align: left;
    text-transform: uppercase;
}

.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background .15s ease; }
.admin-table tbody tr:hover td { background: #f8fbfc; }
.admin-table td:first-child a { font-weight: 600; }

.admin-actions a { margin-right: 8px; }
.admin-muted { color: var(--admin-muted); }

.admin-status,
.admin-type {
    display: inline-flex;
    min-height: 27px;
    padding: 4px 9px;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.admin-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.admin-status.visible { background: #e7f6ef; color: #16704d; }
.admin-status.hidden { background: #fbecee; color: #a33a46; }
.admin-type { background: #eef3f5; color: #556a74; }

.admin-inline-form { display: inline-flex; margin: 0 4px 0 0; }
.admin-link-button {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    color: var(--admin-primary-dark);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.admin-link-button:hover { color: var(--admin-primary); }
.admin-link-button.danger { color: var(--admin-danger); }
.admin-inline-form .admin-link-button[name="dir"] {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #f7f9fa;
    color: #5a6d76;
    text-decoration: none;
}
.admin-inline-form .admin-link-button[name="dir"]:hover {
    border-color: #abd9f0;
    background: var(--admin-primary-soft);
    color: var(--admin-primary-dark);
}

.admin-form label,
.admin-login-form label {
    display: block;
    margin: 18px 0 7px;
    color: #314653;
    font-size: 13px;
    font-weight: 700;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="date"],
.admin-form input[type="number"],
.admin-form input[type="file"],
.admin-form textarea,
.admin-form select,
.admin-login-form input {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #ccd8df;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: var(--admin-text);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.admin-login-form input:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 4px rgba(81, 174, 226, .16);
}

.admin-form textarea { min-height: 180px; resize: vertical; }
.admin-form input[type="checkbox"] { accent-color: var(--admin-primary); }

.admin-section {
    margin-top: 28px;
    padding: clamp(18px, 3vw, 24px);
    border: 1px solid #d9e9f2;
    border-left: 4px solid var(--admin-primary);
    border-radius: 10px;
    background: #f4fafd;
}

.admin-section h2,
.admin-section h3 { margin-top: 0; }

.image-list { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 15px; }
.image-item {
    width: 170px;
    padding: 9px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(27, 58, 77, .06);
    cursor: grab;
}
.image-item.is-dragging { opacity: .45; cursor: grabbing; }
.image-item img { display: block; width: 100%; height: 110px; margin-bottom: 8px; border-radius: 7px; object-fit: cover; }

.admin-menu { display: flex; flex-direction: column; gap: 10px; }
.admin-button.block { width: fit-content; min-width: 220px; text-align: left; }

.admin-login-wrap {
    display: flex;
    min-height: calc(100vh - 180px);
    align-items: center;
    justify-content: center;
}

.admin-login-box { width: min(100%, 430px); padding: clamp(28px, 5vw, 42px); }
.admin-login-box h1 { margin-bottom: 26px; font-size: 32px; }
.admin-login-form input { margin-bottom: 8px; }
.admin-login-button { width: 100%; margin-top: 18px; text-align: center; }

.admin-error,
.admin-success {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 9px;
    transition: opacity .5s ease;
}
.admin-error { border-color: #f0c7cb; background: #fff1f2; color: #9e2632; }
.admin-success { border-color: #bfe4d1; background: #eefaf3; color: #176c46; }

.admin-upload-status {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #b8dff2;
    border-radius: 10px;
    background: #eef8fd;
    color: #246b91;
    font-weight: 600;
}
.admin-upload-status.is-success { border-color: #bfe4d1; background: #eefaf3; color: #176c46; }
.admin-upload-status.has-warning { border-color: #f2d3ad; background: #fff7ed; color: #9b5a15; }

.admin-info-note {
    margin: 10px 0 18px;
    padding: 12px 14px;
    border-left: 3px solid var(--admin-primary);
    border-radius: 8px;
    background: var(--admin-primary-soft);
    color: #476572;
    font-size: 13px;
}

.admin-pagination { display: flex; gap: 8px; align-items: center; }
.admin-icon-actions { display: flex; gap: 7px; align-items: center; }
.admin-icon-btn {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #f7f9fa;
    color: #334955;
    font-size: 0;
    text-decoration: none;
    transition: .15s ease;
}
.admin-icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-icon-btn:hover { border-color: var(--admin-primary); background: var(--admin-primary); color: #fff; transform: translateY(-1px); }
.admin-icon-btn.delete:hover { border-color: var(--admin-danger); background: var(--admin-danger); }

.admin-file-row {
    margin-bottom: 15px;
    padding: 16px;
    border: 1px solid var(--admin-border);
    border-radius: 9px;
    background: #fff;
}

/* Dashboard */
.dashboard-wrapper { max-width: 1120px; margin: 0 auto; }
.dashboard-welcome {
    position: relative;
    overflow: hidden;
    display: flex;
    min-height: 245px;
    margin-bottom: 24px;
    padding: clamp(32px, 5vw, 54px);
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    border-radius: 24px;
    background:
        linear-gradient(130deg, #287fae, rgba(81, 174, 226, .94)),
        #51aee2;
    box-shadow: 0 24px 60px rgba(40, 127, 174, .24);
    color: #fff;
}
.dashboard-welcome::after {
    content: "";
    position: absolute;
    right: -48px;
    top: -116px;
    width: 360px;
    height: 360px;
    border: 58px solid rgba(255, 255, 255, .075);
    border-radius: 50%;
}
.dashboard-welcome-copy { position: relative; z-index: 1; }
.dashboard-welcome h1 { margin: 7px 0 10px; color: #fff; font-size: clamp(34px, 5vw, 52px); }
.dashboard-welcome p { margin: 0; color: rgba(255,255,255,.74); font-size: 16px; }
.dashboard-eyebrow { color: #ffd0a8; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.dashboard-user { position: relative; z-index: 1; display: flex; padding: 12px 16px 12px 12px; align-items: center; gap: 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; background: rgba(255,255,255,.1); backdrop-filter: blur(12px); }
.dashboard-avatar { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 11px; background: #fff; color: var(--admin-primary-dark); font-weight: 750; }
.dashboard-user span:last-child { display: grid; }
.dashboard-user small { color: rgba(255,255,255,.62); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.dashboard-user strong { color: #fff; font-size: 13px; }
.dashboard-section-head { display: flex; margin: 0 0 24px; align-items: end; justify-content: space-between; }
.dashboard-section-head h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.02em; }
.dashboard-section-head .dashboard-eyebrow { color: var(--admin-accent); }
.dashboard-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-menu a,
.dashboard-menu .logout {
    display: flex;
    min-height: 104px;
    padding: 20px;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--admin-border);
    border-radius: 15px;
    background: #fbfcfc;
    color: #244657;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.dashboard-menu a:hover,
.dashboard-menu .logout:hover {
    border-color: #abd9f0;
    box-shadow: 0 14px 30px rgba(40, 127, 174, .11);
    color: var(--admin-primary-dark);
    transform: translateY(-2px);
}
.dashboard-menu .icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: var(--admin-primary-soft);
}
.dashboard-menu .icon svg { width: 24px; height: 24px; fill: none; stroke: var(--admin-primary-dark); stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-item-copy { display: grid; gap: 3px; }
.dashboard-item-copy strong { font-size: 15px; }
.dashboard-item-copy small { color: var(--admin-muted); font-size: 12px; font-weight: 450; }
.dashboard-arrow { margin-left: auto; color: #98aab0; font-size: 20px; transition: transform .15s ease; }
.dashboard-menu a:hover .dashboard-arrow { color: var(--admin-primary); transform: translateX(3px); }
.dashboard-logout-form { grid-column: 1 / -1; margin: 0; }
.dashboard-menu .logout { width: 100%; min-height: 74px; margin-top: 4px; border: 1px solid var(--admin-border); font: inherit; text-align: left; cursor: pointer; background: #f7f9f9; color: #65727b; }
.dashboard-menu .logout .icon { width: 40px; height: 40px; flex-basis: 40px; background: #edf1f2; }
.dashboard-menu .logout .icon svg { width: 20px; height: 20px; stroke: #657780; }
.dashboard-menu .logout:hover { border-color: #d3dadd; color: #384b57; }

@media (max-width: 760px) {
    body { padding: 24px 14px 40px; }
    body::before { min-height: 50px; margin-bottom: 24px; padding: 0 14px; font-size: 9px; }
    .admin-card { padding: 16px; overflow-x: auto; }
    .admin-topbar { align-items: stretch; }
    .admin-topbar .admin-button { flex: 1 1 auto; }
    .admin-table { min-width: 650px; }
    .dashboard-menu { grid-template-columns: 1fr; }
    .dashboard-welcome { min-height: 290px; align-items: flex-start; flex-direction: column; justify-content: flex-end; }
    .dashboard-logout-form { grid-column: auto; }
    .dashboard-menu a { min-height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
