/* ===== PferdeStall Design-Tokens (SPEC Abschnitt 7) ===== */
:root {
    --background: #F5EBE0;
    --surface: #FFFFFF;
    --surface-alt: #EDD9C6;
    --primary: #A9714B;
    --primary-dark: #8B5E3C;
    --secondary: #C68863;
    --text-primary: #4A342A;
    --text-secondary: #8A6F5F;
    --success: #7A8B6F;
    --warning: #C9803F;
    --danger: #A94B4B;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 2px 10px rgba(74, 52, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    font-size: 15px;
}

h1, h2, h3, h4 { color: var(--text-primary); margin: 0 0 0.6em; font-weight: 650; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
p { line-height: 1.5; }

/* ===== Layout ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--surface-alt);
    padding: 1.25rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.sidebar .brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    padding: 0.4rem 0.75rem 1rem;
}
.sidebar .nav-link {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 500;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
}
.sidebar .nav-link:hover { background: var(--background); }
.sidebar .nav-link.active { background: var(--primary); color: #fff; }
.sidebar .nav-section {
    margin: 0.9rem 0.75rem 0.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.sidebar .spacer { flex: 1; }
.sidebar .user-box {
    border-top: 1px solid var(--surface-alt);
    padding: 0.8rem 0.75rem 0.2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.main-content { flex: 1; padding: 2rem 2.5rem; max-width: 1100px; }

/* ===== Karten ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem 1.6rem;
    margin-bottom: 1.25rem;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.1rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--surface-alt); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Formulare ===== */
label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin: 0.7rem 0 0.25rem; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="time"], input[type="number"], textarea, select {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1.5px solid var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}
textarea { min-height: 90px; resize: vertical; }

/* ===== Tabellen ===== */
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
table.data th {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.6rem;
    border-bottom: 2px solid var(--surface-alt);
}
table.data td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--background);
    vertical-align: middle;
}

/* ===== Badges & Chips ===== */
.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--surface-alt);
    color: var(--text-primary);
}
.badge-success { background: var(--success); color: #fff; }
.badge-warning { background: var(--warning); color: #fff; }
.badge-danger { background: var(--danger); color: #fff; }
.badge-secondary { background: var(--secondary); color: #fff; }

/* ===== Banner & Meldungen ===== */
.banner-locked {
    background: var(--danger);
    color: #fff;
    border-radius: var(--radius);
    padding: 0.9rem 1.3rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.alert {
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    margin: 0.8rem 0;
    font-size: 0.9rem;
}
.alert-error { background: #F6E4E4; color: var(--danger); }
.alert-success { background: #E9EDE5; color: var(--success); }
.alert-info { background: var(--surface-alt); color: var(--text-primary); }

/* ===== Dialog ===== */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(74, 52, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.dialog {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(74, 52, 42, 0.25);
    padding: 1.6rem 1.8rem;
    width: min(480px, 92vw);
}
.dialog .dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.3rem;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}
.tabs button {
    border: none;
    background: var(--surface);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
}
.tabs button.active { background: var(--primary); color: #fff; }
.tabs button:hover:not(.active) { background: var(--surface-alt); }

/* ===== Login ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.2rem 2.4rem;
    width: min(400px, 92vw);
}

.row-inline { display: flex; gap: 0.7rem; align-items: flex-end; flex-wrap: wrap; }
.muted { color: var(--text-secondary); font-size: 0.87rem; }

#blazor-error-ui {
    background: var(--warning);
    color: #fff;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
