/* =========================================================
   Persönliches Dashboard
   ========================================================= */

:root {
    --background: #f5f7fa;
    --surface: #ffffff;

    --text: #1f2937;
    --muted: #6b7280;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;

    --border: #e5e7eb;

    --danger: #b91c1c;

    --radius: 14px;

    --shadow:
        0 4px 18px rgba(15, 23, 42, 0.06);
}


/* =========================================================
   Grundlayout
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--background);

    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    font-size: 16px;

    line-height: 1.6;
}

.container {
    width: min(1120px, calc(100% - 40px));

    margin: 0 auto;
}


/* =========================================================
   Header
   ========================================================= */

header {
    background: var(--surface);

    border-bottom:
        1px solid var(--border);

    box-shadow:
        0 1px 4px rgba(15, 23, 42, 0.04);
}

.header-inner {
    min-height: 72px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;
}


/* Logo */

.logo {
    color: var(--text);

    font-size: 1.25rem;

    font-weight: 700;

    white-space: nowrap;
}

.logo:hover {
    color: var(--primary);

    text-decoration: none;
}


/* =========================================================
   Navigation
   ========================================================= */

.user-nav {
    display: flex;

    align-items: center;

    gap: 4px;

    flex-wrap: wrap;
}

.user-nav a {
    display: inline-flex;

    align-items: center;

    padding: 7px 11px;

    border-radius: 8px;

    color: #4b5563;

    font-size: 0.92rem;

    font-weight: 500;

    text-decoration: none;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.user-nav a:hover {
    background: #f3f4f6;

    color: var(--primary);

    text-decoration: none;
}

.user-nav a[href="index.php"],
.user-nav a[href="links.php"] {
    color: var(--primary);
}

.user-nav span {
    margin-left: 8px;

    padding-left: 12px;

    border-left:
        1px solid var(--border);

    color: var(--muted);

    font-size: 0.9rem;

    white-space: nowrap;
}


/* =========================================================
   Hauptbereich
   ========================================================= */

main {
    padding: 45px 0 60px;
}

h1 {
    margin: 0;

    font-size: 2.25rem;

    line-height: 1.2;

    letter-spacing: -0.02em;
}

.subtitle {
    margin: 8px 0 0;

    color: var(--muted);

    font-size: 1.02rem;
}


/* =========================================================
   Dashboard-Karten
   ========================================================= */


.dashboard-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 22px;

    width: 100%;

    margin-top: 32px;

}

.dashboard-card {
    position: relative;

    display: block;

    padding: 28px;

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    color: var(--text);

    text-decoration: none;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);

    border-color: #d1d5db;

    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.09);

    text-decoration: none;
}

.dashboard-icon {
    width: 48px;
    height: 48px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 12px;

    background: #eff6ff;

    font-size: 1.6rem;
}

.dashboard-card h2 {
    margin: 0 0 7px;

    font-size: 1.25rem;
}

.dashboard-card p {
    margin: 0;

    color: var(--muted);

    font-size: 0.95rem;
}


/* =========================================================
   Karten für Unterseiten
   ========================================================= */

.card {
    margin-top: 25px;

    padding: 26px;

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.card h2 {
    margin-top: 0;
}


/* =========================================================
   Formulare
   ========================================================= */

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

label {
    display: block;

    margin-bottom: 7px;

    font-weight: 600;

    font-size: 0.92rem;
}

input,
textarea,
select {
    width: 100%;

    padding: 11px 13px;

    border:
        1px solid #d1d5db;

    border-radius: 9px;

    background: #ffffff;

    color: var(--text);

    font: inherit;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;

    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
    min-height: 150px;

    resize: vertical;
}


/* =========================================================
   Buttons
   ========================================================= */

button,
.button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 10px 16px;

    border: 0;

    border-radius: 9px;

    background: var(--primary);

    color: #ffffff;

    font: inherit;

    font-weight: 600;

    cursor: pointer;

    text-decoration: none;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

button:hover,
.button:hover {
    background: var(--primary-hover);

    color: #ffffff;

    text-decoration: none;

    transform: translateY(-1px);
}

.button-secondary {
    background: #f3f4f6;

    color: #374151;

    border:
        1px solid #e5e7eb;
}

.button-secondary:hover {
    background: #e5e7eb;

    color: #111827;
}


/* =========================================================
   Link-Liste
   ========================================================= */

.link-list {
    list-style: none;

    margin: 0;

    padding: 0;
}

.link-item {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 17px 0;

    border-bottom:
        1px solid var(--border);
}

.link-item:last-child {
    border-bottom: none;
}

.link-item > div:first-child {
    min-width: 0;

    flex: 1;
}

.link-title {
    display: inline-block;

    color: var(--primary);

    font-weight: 600;

    text-decoration: none;
}

.link-title:hover {
    color: var(--primary-hover);

    text-decoration: underline;
}

.link-url {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 0.88rem;

    overflow-wrap: anywhere;
}


/* =========================================================
   Bearbeiten / Löschen
   ========================================================= */

.actions {
    display: flex;

    align-items: center;

    gap: 7px;

    flex-shrink: 0;
}

.icon-button {
    width: 35px;
    height: 35px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border:
        1px solid var(--border);

    border-radius: 8px;

    background: #ffffff;

    color: #374151;

    font-size: 1rem;

    cursor: pointer;

    text-decoration: none;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.icon-button:hover {
    transform: translateY(-1px);

    text-decoration: none;
}

.edit-button:hover {
    background: #f3f4f6;

    border-color: #d1d5db;
}

.delete-button {
    color: var(--danger);
}

.delete-button:hover {
    background: #fff1f2;

    border-color: #fecaca;
}


/* =========================================================
   Meldungen
   ========================================================= */

.alert {
    margin-top: 22px;

    padding: 12px 15px;

    border-radius: 9px;

    font-size: 0.94rem;
}

.alert-success {
    background: #ecfdf5;

    color: #166534;

    border:
        1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;

    color: #991b1b;

    border:
        1px solid #fecaca;
}


/* =========================================================
   Footer
   ========================================================= */

footer {
    padding: 30px 0 35px;

    color: var(--muted);

    text-align: center;

    font-size: 0.85rem;
}


/* =========================================================
   Smartphone
   ========================================================= */

@media (max-width: 800px) {

    .header-inner {
        padding: 14px 0;

        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
    }

    .user-nav {
        width: 100%;

        gap: 3px;
    }

    .user-nav span {
        margin-left: auto;
    }

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

    main {
        padding-top: 30px;
    }

}


@media (max-width: 520px) {

    .container {
        width: calc(100% - 24px);
    }

    h1 {
        font-size: 1.8rem;
    }

    .user-nav {
        align-items: flex-start;

        flex-direction: column;
    }

    .user-nav span {
        margin-left: 0;

        padding-left: 0;

        border-left: 0;
    }

    .dashboard-card {
        padding: 22px;
    }

    .card {
        padding: 20px;
    }

    .link-item {
        align-items: flex-start;
    }

    .actions {
        margin-top: 2px;
    }
.note-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 10px;
}

.note-header h3 {
    margin: 0;

    flex: 1;
}

.note-header .actions {
    flex-shrink: 0;

.note-title-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
}

.note-title-row h3 {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 !important;
}

.note-edit-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    flex: 0 0 35px !important;

    width: 35px !important;
    height: 35px !important;

    margin: 0 0 0 15px !important;
    padding: 0 !important;

    border: 1px solid #e5e7eb;
    border-radius: 8px;

    background: #ffffff;

    color: #374151;

    text-decoration: none !important;

    line-height: 1;
}

.note-edit-button:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    text-decoration: none !important;
}
/* =========================================
   Google Kalender
   ========================================= */

.calendar-card {
    text-align: left;
}

.calendar-card .dashboard-icon,
.calendar-card h2 {
    text-align: center;
}

.calendar-events {
    margin-top: 20px;
}

.calendar-event {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-event:last-child {
    border-bottom: none;
}

.calendar-event-date {
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: #6b7280;
}

.calendar-event-title {
    display: block;
}

.calendar-event-location {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #6b7280;
}
.calendar-event-title {
    display: block;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

a.calendar-event-title:hover {
    color: var(--primary);
    text-decoration: underline;
}