/* /backend/public/css/app.css
 * shadcn/ui-inspiriertes Design, ohne externe Frameworks.
 */

/* ---------- Design-Tokens (immer helles Design) ---------- */
:root {
    color-scheme: light;
    --background: #fafafa;
    --foreground: #09090b;
    --muted: #f4f4f5;
    --muted-foreground: #71717a;
    --card: #ffffff;
    --border: #e4e4e7;
    --input: #e4e4e7;
    --ring: #a1a1aa;
    --primary: #18181b;
    --primary-foreground: #fafafa;
    --primary-hover: #27272a;
    --destructive: #dc2626;
    --success: #16a34a;
    --radius: 0.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 56rem;
    margin: 0 auto;
    padding: 3rem 1rem;
    display: grid;
    gap: 1.5rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.page-header p {
    margin: 0.25rem 0 0;
    color: var(--muted-foreground);
}

/* ---------- Card ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-description {
    margin: 0.25rem 0 0;
    color: var(--muted-foreground);
}

.card-content {
    padding: 1.5rem;
}

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

.field {
    display: grid;
    gap: 0.5rem;
}

.field label {
    font-weight: 500;
    line-height: 1;
}

.input,
.textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--input);
    border-radius: var(--radius);
    font: inherit;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input {
    height: 2.25rem;
}

.textarea {
    min-height: 6rem;
    resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--muted-foreground);
}

.input:focus-visible,
.textarea:focus-visible {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 35%, transparent);
}

/* Fehlermeldungen des Symfony-Validators (form_errors rendert <ul><li>) */
.field ul {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--destructive);
    font-size: 0.8125rem;
}

.field:has(ul) .input,
.field:has(ul) .textarea {
    border-color: var(--destructive);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

/* ---------- Button ---------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 1rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.15s;
}

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

.button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
}

.button-icon {
    width: 2.25rem;
    padding: 0;
}

/* Unauffälliger Button, der erst beim Hover rot wird */
.button-ghost-destructive {
    background: transparent;
    color: var(--muted-foreground);
    box-shadow: none;
}

.button-ghost-destructive:hover {
    background: color-mix(in srgb, var(--destructive) 10%, transparent);
    color: var(--destructive);
}

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    background: var(--muted);
    color: var(--foreground);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Tabelle ---------- */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
}

.table thead th {
    height: 2.5rem;
    padding-block: 0;
    vertical-align: middle;
    background: var(--muted);
    color: var(--muted-foreground);
    font-weight: 500;
}

.table tbody tr {
    border-top: 1px solid var(--border);
    transition: background-color 0.15s;
}

.table tbody tr:hover {
    background: color-mix(in srgb, var(--muted) 50%, transparent);
}

.table .cell-date {
    width: 1%;
    white-space: nowrap;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

.table .cell-name {
    width: 1%;
    white-space: nowrap;
    font-weight: 500;
}

.table .cell-note {
    overflow-wrap: anywhere;
}

.table .cell-actions {
    width: 1%;
    padding-block: 0.375rem;
    text-align: right;
    vertical-align: middle;
}

.table .cell-actions form {
    margin: 0;
}

/* Nur für Screenreader sichtbar */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Alert ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: alert-in 0.2s ease-out;
}

.alert-success {
    --alert-accent: var(--success);
    border-color: color-mix(in srgb, var(--alert-accent) 40%, var(--border));
    background: color-mix(in srgb, var(--alert-accent) 8%, var(--card));
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--alert-accent, var(--foreground));
}

.alert-title {
    margin: 0;
    font-weight: 500;
    line-height: 1.25;
}

.alert-description {
    margin: 0.25rem 0 0;
    color: var(--muted-foreground);
}

@keyframes alert-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Leerer Zustand ---------- */
.empty {
    padding: 2.5rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted-foreground);
}
