/* Grundlayout */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
    color: #111827;
}

a {
    color: #2563eb;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header / Top-Navigation */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0f172a;
    color: #e5e7eb;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.6);
}

.app-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-logo {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #0f172a;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
}

.app-role-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.25);
    color: #e5e7eb;
}

.app-header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 14px;
}

.app-header-nav a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 999px;
    transition: background 0.15s ease;
}
.app-header-nav a:hover {
    background: rgba(148, 163, 184, 0.25);
}

/* Hauptbereich */
.app-main {
    max-width: 1200px;
    margin: 1.5rem auto 2rem;
    padding: 0 1.5rem;
    flex: 1;
}

/* Fußzeile */
.app-footer {
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    background: #f9fafb;
}

/* Karten / Boxen */
.card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    margin-bottom: 1.25rem;
}

.card-header {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.card-subtitle {
    font-size: 13px;
    color: #6b7280;
}

.card-body {
    padding: 1.0rem 1.2rem 1.2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}
.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: #ffffff;
    color: #111827;
    border-color: #d1d5db;
}
.btn-secondary:hover {
    background: #f3f4f6;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border-color: #b91c1c;
}
.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

.btn-ghost {
    background: transparent;
    color: #374151;
    border-color: transparent;
}
.btn-ghost:hover {
    background: #f3f4f6;
}

/* Tabellen */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
}

table thead tr {
    background: #f9fafb;
}

th, td {
    padding: 0.5rem 0.6rem;
    font-size: 13px;
    border-bottom: 1px solid #e5e7eb;
}

th {
    text-align: left;
    font-weight: 600;
    color: #374151;
}

tbody tr:nth-child(even) {
    background: #f9fafb;
}

tbody tr:hover {
    background: #eef2ff;
}

.text-right {
    text-align: right;
}
.text-center {
    text-align: center;
}

/* Messages */
.alert {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 0.75rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

/* Formulare */
.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem 1rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.35rem 0.5rem;
    font-size: 13px;
    width: 100%;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Top Actions (Buttons oben rechts) */
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.badge-optional {
    background: #fef3c7;
    color: #92400e;
}

.badge-recommendation {
    background: #e0f2fe;
    color: #075985;
}

.badge-contract {
    background: #dcfce7;
    color: #166534;
}

/* Responsiv */
@media (max-width: 768px) {
    .app-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .app-main {
        padding: 0 1rem;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .app-header-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}
