/* ====== Basis & Farben ====== */
:root {
    --primary: #3A6EA5;
    --primary-bg: #E8F0FB;
    --bg: #F4F5F7;
    --card-bg: #FFFFFF;
    --border: #E0E0E0;
    --text: #333333;
    --text-muted: #777777;
    --danger: #C62828;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    padding: 0;
}

/* ====== Header / AppBar ====== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
}

.header-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.header-link:hover {
    background: var(--primary-bg);
}

/* ====== Main & Cards ====== */

.app-main {
    padding: 12px 12px 80px; /* unten Platz für Bottom-Nav */
    max-width: 900px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.card p {
    margin: 4px 0;
}

/* ====== Formulare ====== */

form .row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
textarea {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    width: 100%;
    max-width: 100%;
}

textarea {
    min-height: 80px;
}

button,
.button,
.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    background: var(--primary);
    color: #fff;
    margin-top: 5px;
}

button.secondary,
.button.secondary {
    background: #f5f5f5;
    color: var(--text);
}

button.danger,
.button.danger {
    background: var(--danger);
}

button:hover,
.button:hover {
    filter: brightness(0.95);
}

/* ====== Tabellen ====== */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 6px 4px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}

th {
    font-weight: 600;
    color: var(--text-muted);
}

tr:last-child td {
    border-bottom: none;
}

/* ====== Icon Buttons ====== */

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f4f4f4;
    transition: 0.2s;
    text-decoration: none;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
}

.icon-btn:hover {
    background: var(--primary-bg);
}

.icon-btn.danger svg {
    stroke: var(--danger);
}

/* ====== Status-Toggle (Aktiv/Inaktiv) ====== */

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 4px 4px;
    border-radius: 999px;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid transparent;
        font-weight: 500;
}

.status-pill.active {
    background-color: #dcfce7;
    color: #15803d;
    border-color: #A5D6A7;
}

.status-pill.inactive {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #FFCDD2;
}



/* ====== Bottom Navigation ====== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    z-index: 20;
}

.bottom-nav .nav-item {
    flex: 1;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bottom-nav .nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
    background: var(--primary-bg);
}

/* ====== Sonstiges ====== */

.text-center {
    text-align: center;
}

.badge {
    display:inline-block;
    padding:2px 6px;
    border-radius:999px;
    background:#eee;
    font-size:11px;
}

/* Mobil etwas enger */
@media (max-width: 600px) {
    .app-main {
        padding: 8px 8px 70px;
    }

    .card {
        padding: 10px;
        margin-bottom: 10px;
    }

    th, td {
        padding: 4px 3px;
    }
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background-color: #f3f4f6;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
}

.icon-button:hover {
    background-color: #e5edff;
    color: #2563eb;
}

.chip {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    background-color: #e5e7eb;
    color: #374151;
    font-size: 11px;
    text-decoration: none;
    margin: 2px 4px 2px 0;
}

.chip-active {
    background-color: #e5edff;
    color: #2563eb;
}

.chip-small {
    font-size: 11px;
    padding: 2px 6px;
}

/* Allgemeine Pill-Darstellung */
.tag-pill{
    display:inline-block;
    padding:6px 12px;
    background:#f2f2f2;
    border-radius:14px;
    font-size:14px;
    color:#333;
    text-decoration:none;
    transition:all .15s ease-in-out;
    border:1px solid #ddd;
}

.tag-pill:hover{
    background:#e6f0ff;
    color:#0a57d0;
    border-color:#0a57d0;
}

/* Aktiv ausgewählt */
.tag-selected{
    background:#dbe9ff !important;
    color:#0a57d0 !important;
    border-color:#0a57d0 !important;
    font-weight:600;
}

/* Auswahl beim Erstellen */
.tag-select{
    display:inline-block;
    background:#f9f9f9;
    padding:4px 8px;
    border-radius:10px;
    border:1px solid #ddd;
    font-size:13px;
}

/* Abstand */
.tag-select + .tag-select{
    margin-left:6px;
}