/* Urlaubstagebuch – Basis-Optik
   Palette: warmes Papierweiß, tiefes Kartenblau, gedämpftes Ockergelb
   Typo: Serif für Überschriften (Reisetagebuch-Charakter), klare Sans für UI */

:root {
    --paper: #fdfcf9;
    --paper-line: #e4ded0;
    --ink: #1c2b33;
    --ink-soft: #4b5a61;
    --map-blue: #2c5f6f;
    --map-blue-deep: #1c3f4b;
    --gold: #b9852c;
    --gold-soft: #f1e2c2;
    --error: #a3392c;
    --radius: 3px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin: 0 0 0.4em;
    color: var(--map-blue-deep);
}

a { color: var(--map-blue); }

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

/* --- Login / Auth-Seiten: Split-Layout --- */
.auth-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

.auth-story {
    background: var(--map-blue-deep);
    color: #f4efe2;
    padding: 4rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-story::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -60px;
    width: 260px;
    height: 260px;
    border: 1.5px dashed rgba(244, 239, 226, 0.25);
    border-radius: 50%;
}

.auth-story .stamp {
    align-self: flex-start;
    border: 2px solid var(--gold-soft);
    color: var(--gold-soft);
    padding: 0.35em 0.8em;
    font-family: ui-serif, Georgia, serif;
    letter-spacing: 1.5px;
    font-size: 0.8rem;
    transform: rotate(-3deg);
}

.auth-story h1 {
    color: #f4efe2;
    font-size: 2.4rem;
    max-width: 11ch;
    margin-top: 2rem;
}

.auth-story p {
    color: #cdd9d3;
    max-width: 34ch;
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 380px;
}

.auth-card .eyebrow {
    color: var(--gold);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.field {
    margin-bottom: 1.1rem;
}

.field label {
    display: block;
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin-bottom: 0.3rem;
}

.field input {
    width: 100%;
    padding: 0.65em 0.8em;
    border: 1px solid var(--paper-line);
    border-radius: var(--radius);
    font-size: 1rem;
    background: #fff;
    color: var(--ink);
}

.field input:focus {
    outline: 2px solid var(--map-blue);
    outline-offset: 1px;
    border-color: var(--map-blue);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75em 1em;
    background: var(--map-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover { background: var(--map-blue-deep); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background: transparent;
    color: var(--map-blue);
    border: 1px solid var(--map-blue);
}
.btn-secondary:hover { background: var(--paper-line); }

.link-row {
    margin-top: 0.9rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

.message {
    padding: 0.7em 0.9em;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.message.error { background: #fbe9e6; color: var(--error); border: 1px solid #f0c9c2; }
.message.success { background: #eaf1e6; color: #3c6b2e; border: 1px solid #cfe3c5; }

/* --- App-Shell (nach Login) --- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--paper-line);
}

.app-header .brand {
    font-family: ui-serif, Georgia, serif;
    font-size: 1.2rem;
    color: var(--map-blue-deep);
}

.app-header .header-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.app-header .header-links a {
    white-space: nowrap;
}

.app-main {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.list {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    margin-top: 1rem;
}
table.list th, table.list td {
    text-align: left;
    padding: 0.6em 0.7em;
    border-bottom: 1px solid var(--paper-line);
    font-size: 0.92rem;
}
table.list th { color: var(--ink-soft); font-weight: 600; }

.badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    font-size: 0.78rem;
    background: var(--gold-soft);
    color: #6b4a12;
}
.badge.admin { background: var(--map-blue); color: #fff; }

.row-actions button {
    background: none;
    border: none;
    color: var(--map-blue);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    margin-right: 0.8rem;
}
.row-actions button.danger { color: var(--error); }

/* Größere Tap-Ziele für Touch-Bedienung */
.btn, .row-actions button, .header-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.link-row a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 760px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-story { display: none; }

    body { font-size: 16.5px; }

    .app-header {
        padding: 0.9rem 1.1rem;
    }

    .app-main {
        padding: 1.25rem 1.1rem;
    }

    .auth-form-side { padding: 1.25rem; }

    /* Formular mit Name/E-Mail/Rolle/Button im Admin-Bereich stapeln */
    #createForm {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.9rem;
    }
    #createForm .field { width: 100%; }
    #createForm select { width: 100%; }
    #createForm .btn { width: 100%; }

    .row-actions {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        align-items: flex-start;
    }
    .row-actions button { margin-right: 0; }

    h2 { font-size: 1.4rem; }
}

@media (max-width: 420px) {
    .auth-card .eyebrow { font-size: 0.8rem; }
    .app-header .brand { font-size: 1.05rem; }
}
