/* ==========================================================================
   Digitalisierungsoffensive Elsbeere Wienerwald
   Design angelehnt an www.elsbeere-wienerwald.at
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green-dark: #2d5a27;
    --green: #4a7c59;
    --green-light: #6b9e5e;
    --green-pale: #e8f0e4;
    --green-bg: #f4f8f2;
    --gold: #b8860b;
    --gold-light: #d4a843;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #dddddd;
    --gray-400: #bbbbbb;
    --red: #c0392b;
    --red-light: #fdecea;
    --blue: #2980b9;
    --blue-light: #ebf5fb;
    --orange: #e67e22;
    --orange-light: #fef5e7;
    --radius: 6px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --transition: 0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-dark); }

img { max-width: 100%; height: auto; }

/* --- Header --- */
.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--green);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.logo-link { text-decoration: none; }

.logo-area {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    width: auto;
}

.login-logo {
    height: 80px;
    width: auto;
    margin-bottom: 1rem;
}

/* --- Navigation --- */
.main-nav { display: flex; align-items: center; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--green-dark);
    transition: var(--transition);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a:not(.btn) {
    padding: 0.5rem 1rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}

.nav-links a:not(.btn):hover {
    background: var(--green-pale);
    color: var(--green-dark);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--gray-300);
}

.user-badge {
    font-size: 0.85rem;
    color: var(--green-dark);
    font-weight: 600;
    background: var(--green-pale);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* --- Main Content --- */
.site-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--green);
    color: var(--white);
}
.btn-primary:hover { background: var(--green-dark); color: var(--white); }

.btn-secondary {
    background: var(--gray-200);
    color: var(--text);
}
.btn-secondary:hover { background: var(--gray-300); }

.btn-outline {
    background: transparent;
    color: var(--green);
    border: 1.5px solid var(--green);
}
.btn-outline:hover { background: var(--green); color: var(--white); }

.btn-danger {
    background: var(--red);
    color: var(--white);
}
.btn-danger:hover { background: #a93226; color: var(--white); }

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
}

.btn-gold {
    background: var(--gold);
    color: var(--white);
}
.btn-gold:hover { background: var(--gold-light); color: var(--white); }

.btn:disabled, .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Cards --- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-header h2, .card-header h3 {
    font-size: 1.1rem;
    color: var(--green-dark);
    font-weight: 700;
}

/* --- Login Page --- */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--green-bg) 0%, var(--white) 50%, var(--green-pale) 100%);
    padding: 2rem;
}

.login-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.login-hero p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.login-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-card h2 {
    font-size: 1.2rem;
    color: var(--green-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* --- Alerts --- */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.alert-error {
    background: var(--red-light);
    color: var(--red);
    border-left: 3px solid var(--red);
}

.alert-success {
    background: var(--green-pale);
    color: var(--green-dark);
    border-left: 3px solid var(--green);
}

.alert-info {
    background: var(--blue-light);
    color: var(--blue);
    border-left: 3px solid var(--blue);
}

.alert-warning {
    background: var(--orange-light);
    color: var(--orange);
    border-left: 3px solid var(--orange);
}

/* --- Status Badges --- */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-draft { background: var(--gray-200); color: var(--text-light); }
.status-pending { background: var(--orange-light); color: var(--orange); }
.status-approved { background: var(--green-pale); color: var(--green-dark); }
.status-rejected { background: var(--red-light); color: var(--red); }

/* --- Dashboard Info Sections --- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border-top: 3px solid var(--green);
}

.info-card h3 {
    color: var(--green-dark);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.info-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green-dark);
}

.info-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.info-card p, .info-card ul {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.7;
}

.info-card ul {
    padding-left: 1.2rem;
}

.info-card ul li {
    margin-bottom: 0.3rem;
}

/* --- Page Intro --- */
.page-intro {
    margin-bottom: 2rem;
}

.page-intro h1 {
    font-size: 1.5rem;
    color: var(--green-dark);
    margin-bottom: 0.5rem;
}

.page-intro p {
    color: var(--text-light);
    font-size: 0.95rem;
    max-width: 700px;
}

/* --- Section Header --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header h2 {
    font-size: 1.25rem;
    color: var(--green-dark);
}

/* --- Antrag List --- */
.antrag-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.antrag-item {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: box-shadow var(--transition);
}

.antrag-item:hover { box-shadow: var(--shadow-lg); }

.antrag-info { flex: 1; }

.antrag-info h3 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.antrag-info .meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.antrag-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* --- Antrag Detail --- */
.antrag-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.antrag-detail-header h1 {
    font-size: 1.35rem;
    color: var(--green-dark);
}

/* --- Dokumente Table --- */
.doc-table {
    width: 100%;
    border-collapse: collapse;
}

.doc-table th,
.doc-table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}

.doc-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--gray-50);
}

.doc-table tr:hover td { background: var(--green-bg); }

.doc-deleted td {
    opacity: 0.5;
    text-decoration: line-through;
}

.doc-deleted-admin {
    background: var(--red-light) !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

.doc-deleted-admin td {
    opacity: 1 !important;
    text-decoration: none !important;
}

.deleted-hint {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* --- Upload Area --- */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    background: var(--gray-50);
    transition: border-color var(--transition), background var(--transition);
}

.upload-area:hover {
    border-color: var(--green);
    background: var(--green-bg);
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state svg { margin-bottom: 1rem; opacity: 0.4; }

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--green-dark);
    color: rgba(255, 255, 255, 0.85);
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-col h4 {
    color: var(--white);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.footer-col p, .footer-col a {
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-col a { color: rgba(255, 255, 255, 0.8); }
.footer-col a:hover { color: var(--white); }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
}

/* --- Admin Page --- */
.admin-header {
    background: var(--green-dark);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.admin-header h1 {
    font-size: 1.3rem;
}

.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
    overflow-x: auto;
}

.admin-tab {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all var(--transition);
}

.admin-tab:hover { color: var(--green-dark); }
.admin-tab.active {
    color: var(--green-dark);
    border-bottom-color: var(--green);
}

.log-entry {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.85rem;
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.log-entry:hover { background: var(--gray-50); }

.log-time {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
    min-width: 140px;
}

.log-action {
    font-weight: 600;
    color: var(--green-dark);
    min-width: 120px;
}

.log-user {
    color: var(--blue);
    min-width: 100px;
}

.log-details {
    color: var(--text-light);
    flex: 1;
}

/* --- Confirm Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-box h3 {
    color: var(--green-dark);
    margin-bottom: 0.75rem;
}

.modal-box p {
    color: var(--text-light);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* --- Helper --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .header-inner { min-height: 60px; }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--gray-200);
    }

    .nav-links.open { display: flex; }

    .nav-links a:not(.btn) {
        padding: 0.75rem 1rem;
    }

    .nav-user {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding-top: 0.75rem;
        border-top: 1px solid var(--gray-200);
        width: 100%;
        justify-content: space-between;
    }

    .site-main { padding: 1.25rem 1rem; }

    .antrag-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .antrag-actions { width: 100%; }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .doc-table { font-size: 0.82rem; }
    .doc-table th, .doc-table td { padding: 0.5rem 0.6rem; }

    .login-card { padding: 1.75rem; }

    .log-entry {
        flex-direction: column;
        gap: 0.25rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn { width: 100%; justify-content: center; }

    .footer-inner { grid-template-columns: 1fr; }

    .admin-tabs { gap: 0; }
}

@media (max-width: 480px) {
    .logo-title { font-size: 1rem; }
    .logo-subtitle { font-size: 0.7rem; }
    .page-intro h1 { font-size: 1.25rem; }
}
