/* sections.css — Card-basiertes Layout für klare Section-Trennung
   Inspiriert vom News-Calendar-Dashboard, aber helles Theme für Endkunden-App.
   Wirkt nur wenn die Templates die Klassen .page-card, .page-card-head etc. nutzen. */

@keyframes section-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Body bekommt einen leichten Hintergrund damit die weißen Cards "schweben" */
body {
    background: #f5f7fa;
}

/* Container-Abstand: weniger ist mehr */
body > main { padding-top: 1.2em; padding-bottom: 2em; }

/* ========== CARD ========== */
.page-card {
    background: #ffffff;
    border: 1px solid #e5e9ef;
    border-radius: 12px;
    padding: 1.4em 1.6em;
    margin-bottom: 1.4em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    animation: section-fadein 0.25s ease;
}

.page-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6em;
    margin: -0.2em 0 1em 0;
    padding-bottom: 0.7em;
    border-bottom: 1px solid #eef1f5;
}

.page-card-head .title {
    margin: 0;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.page-card-head .title .count {
    background: #eef2ff;
    color: #4338ca;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.85em;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 600;
}

.page-card-head .actions {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.page-card-head .actions button,
.page-card-head .actions a.button-link {
    padding: 0.35em 0.85em;
    font-size: 0.88em;
    border-radius: 6px;
}

/* ========== HEADER-CARD: Edit-Toggle (global für Projekt + Gerät) ========== */
.header-edit-btn {
    position: absolute; top: 0.6em; right: 0.8em;
    background: transparent; border: 1px solid #d0d0d0;
    border-radius: 6px; padding: 4px 10px; cursor: pointer;
    font-size: 1.05em; color: #555;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.header-edit-btn:hover { background: #f0f0f0; border-color: #888; color: #222; }
.icon-pencil { font-size: 1.1em; line-height: 1; }
.project-header-edit-actions {
    display: flex; gap: 0.6em; margin-top: 0.8em; align-items: center;
}
.header-save-btn {
    background: #1b5e20; color: white; border: none;
    padding: 0.45em 1.1em; border-radius: 6px; cursor: pointer;
    font-size: 0.95em; font-weight: 500;
}
.header-save-btn:hover { background: #2e7d32; }
.header-cancel-btn {
    background: #6b7280; color: white; border: none;
    padding: 0.45em 1.1em; border-radius: 6px; cursor: pointer;
    font-size: 0.95em; font-weight: 500;
}
.header-cancel-btn:hover { background: #4b5563; }

/* ========== PROJEKT-HEADER (großes Card mit Titel + Status) ========== */
.project-header-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e9ef;
    border-radius: 12px;
    padding: 1.6em 1.8em;
    margin-bottom: 1.4em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: relative;
}

.project-header-card h2 {
    margin: 0 0 0.4em 0;
    font-size: 1.6em;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.6em;
    flex-wrap: wrap;
}

.project-header-card .meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6em 1.4em;
    margin-top: 0.8em;
}

.project-header-card .meta-grid .meta-key {
    font-size: 0.75em;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.project-header-card .meta-grid .meta-val {
    font-size: 0.95em;
    color: #1f2937;
    font-weight: 500;
}

/* ========== EMPTY-STATE ========== */
.empty-state {
    text-align: center;
    padding: 2em 1em;
    color: #9ca3af;
    font-style: italic;
    font-size: 0.92em;
}

.empty-state .icon { font-size: 2em; margin-bottom: 0.4em; opacity: 0.6; }

/* ========== INLINE-FORMS in Card-Head ========== */
.inline-form {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.inline-form input[type=file] {
    font-size: 0.88em;
    padding: 0.2em 0;
    margin: 0;
}

.inline-form select { font-size: 0.88em; padding: 0.3em 0.5em; margin: 0; }

/* ========== TABELLEN in Cards (kompakter) ========== */
.page-card table {
    margin: 0;
    font-size: 0.92em;
}

.page-card table th {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid #e5e9ef;
    padding: 0.5em 0.7em;
}

.page-card table td {
    padding: 0.5em 0.7em;
    border-bottom: 1px solid #f3f4f6;
}

.page-card table tbody tr:hover {
    background: #f9fafb;
    transition: background 0.15s;
}

/* ========== HEADER (oben) — etwas dezenter ========== */
header {
    background: white;
    padding: 0.8em 1.4em;
    border-bottom: 1px solid #e5e9ef;
    margin-bottom: 0;
    border-radius: 0;
}

header h1 {
    font-size: 1.2em;
    font-weight: 700;
    color: #1e3a8a;
}

header h1 a { color: inherit; text-decoration: none; }

nav a {
    color: #4b5563;
    font-weight: 500;
    text-decoration: none;
    padding: 0.3em 0.6em;
    border-radius: 6px;
    transition: background 0.15s;
}

nav a:hover { background: #eef2ff; color: #4338ca; }
