/* Einfaches, lesbares Layout — alles extern, kein Inline-Chaos */

:root {
    --bg: #f4f6f8;
    --surface: #fff;
    --text: #1a1a1a;
    --muted: #5c6570;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger: #b91c1c;
    --danger-hover: #991b1b;
    --border: #d1d9e0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}

.site-header h1 {
    margin: 0;
    font-size: 1.35rem;
}

.site-header h1 a {
    color: var(--text);
    text-decoration: none;
}

.site-header h1 a:hover {
    color: var(--accent);
}

.tagline {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.main-nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.main-nav a:hover {
    text-decoration: underline;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

.site-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1.25rem;
}

.toolbar form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
    flex: 1;
    min-width: 200px;
}

.filter-form > div {
    min-width: 10rem;
}

.small-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
}

.small-hint a {
    color: var(--accent);
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="search"],
textarea,
select {
    font: inherit;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    width: 100%;
    max-width: 100%;
}

textarea {
    min-height: 5rem;
    resize: vertical;
}

.btn {
    display: inline-block;
    font: inherit;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--muted);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.875rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

/* Kontaktliste: klassische Tabelle, Zeilen umbrechen statt endlos breit */
table.contact-list {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table.contact-list th,
table.contact-list td {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    padding: 0.55rem 0.5rem;
    vertical-align: top;
}

table.contact-list td.row-actions {
    white-space: normal;
    line-height: 1.5;
}

table.contact-list td.row-actions form {
    display: inline-block;
    vertical-align: middle;
}

table.contact-list td.row-actions .btn {
    margin: 0.15rem 0.35rem 0.15rem 0;
}

table.contact-list th:nth-child(1),
table.contact-list td:nth-child(1) {
    width: 12%;
}

table.contact-list th:nth-child(2),
table.contact-list td:nth-child(2) {
    width: 14%;
}

table.contact-list th:nth-child(3),
table.contact-list td:nth-child(3) {
    width: 22%;
}

table.contact-list th:nth-child(4),
table.contact-list td:nth-child(4) {
    width: 12%;
}

table.contact-list th:nth-child(5),
table.contact-list td:nth-child(5) {
    width: 16%;
}

table.contact-list th:nth-child(6),
table.contact-list td:nth-child(6) {
    width: 11%;
}

table.contact-list th:nth-child(7),
table.contact-list td:nth-child(7) {
    width: 13%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    background: #eef2f7;
    font-weight: 600;
}

th a {
    color: var(--accent);
    text-decoration: none;
}

th a:hover {
    text-decoration: underline;
}

tr:last-child td {
    border-bottom: none;
}

.row-actions {
    white-space: nowrap;
}

.row-actions form {
    display: inline;
}

.errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    list-style: none;
}

.errors li {
    margin: 0.15rem 0;
}

.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.pagination .btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
