/*
 * Farbschema aus CLAUDE_1.md Abschnitt 13, erweitert um das Redesign aus
 * design-drafts/ASV-App UI Redesign.html (Design/UI-Politur nach M6) - die
 * Primaerfarb-Skala ist unveraendert identisch, neu sind semantische
 * Flaechen-/Status-Token, Typografie (Fraunces/Public Sans, siehe
 * fonts.css) und abgerundetere Komponenten (Karten, Badges, Buttons).
 */
:root {
    --bs-primary: #1A80B6;
    --bs-primary-rgb: 26, 128, 182;

    --primary-50:  #EFF7FA;
    --primary-100: #D8EAF4;
    --primary-200: #B0D4E8;
    --primary-300: #7CBCDE;
    --primary-400: #42A3D7;
    --primary-500: #1A80B6;
    --primary-600: #166A98;
    --primary-700: #0F557B;
    --primary-800: #0A3F5C;

    --bs-body-bg: #F9FAFB;
    --bs-border-color: #DCE7ED;
    --bs-secondary-color: #5B6E76;
    --bs-body-color: #1D2930;
    --surface: #FFFFFF;

    --bs-success: #1E7A3D;
    --succ-bg: #E5F5EA;
    --succ: #1E7A3D;
    --bs-warning: #8A5A05;
    --warn-bg: #FDECD1;
    --warn: #8A5A05;
    --bs-danger: #D64545;
    --accent: #E8A93A;

    --bs-link-color: #1A80B6;
    --bs-link-hover-color: #166A98;

    --bs-body-font-family: 'Public Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-border-radius: .75rem;
    --bs-border-radius-lg: 1rem;
    --bs-border-radius-sm: .5rem;
}

body {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

h1, h2, h3, .font-serif {
    font-weight: 600;
}

a {
    color: #166a98;
    text-decoration: none;
    font-weight: 500;
}

.navbar-brand {
    color: var(--bs-primary);
}

/*
 * Shared presentation for every icon() SVG (see src/Support/helpers.php +
 * public/assets/icons/sprite.svg) - fill/stroke/stroke-* are inheritable SVG
 * properties, so setting them once here reaches every <use>-referenced
 * <symbol> path exactly like the old per-call inline attributes did. Only
 * width/height (vary per call) and viewBox (no CSS equivalent) stay inline.
 */
.icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn {
    --bs-btn-border-radius: .7rem;
}

.btn-primary {
    --bs-btn-bg: #1A80B6;
    --bs-btn-border-color: #1A80B6;
    --bs-btn-hover-bg: #166A98;
    --bs-btn-hover-border-color: #166A98;
}

/*
 * Bootstrap's compiled .btn-outline-primary bakes its own scoped
 * --bs-btn-* custom properties to a hardcoded #0d6efd at build time -
 * it never actually read --bs-primary, so every outline-primary button
 * in the app has been rendering in Bootstrap's default blue instead of
 * the theme color. Values below match the redesign mockup's outline
 * buttons (Profil/Digitaler Ausweis on Start, "Gewaesser" on Meine
 * Karten: border var(--p200), text var(--p700), white background).
 */
.btn-outline-primary {
    --bs-btn-color: var(--primary-700);
    --bs-btn-border-color: var(--primary-200);
    --bs-btn-hover-color: var(--primary-700);
    --bs-btn-hover-bg: var(--primary-50);
    --bs-btn-hover-border-color: var(--primary-300);
    --bs-btn-active-color: var(--primary-700);
    --bs-btn-active-bg: var(--primary-50);
    --bs-btn-active-border-color: var(--primary-300);
    --bs-btn-disabled-color: var(--primary-700);
    --bs-btn-disabled-border-color: var(--primary-200);
}

/* Same fix, for the "Zurueck"-style outline button seen on the Adminbereich mockup. */
.btn-outline-secondary {
    --bs-btn-color: var(--bs-secondary-color);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-secondary-color);
    --bs-btn-hover-bg: var(--bs-body-bg);
    --bs-btn-hover-border-color: var(--bs-secondary-color);
    --bs-btn-active-color: var(--bs-secondary-color);
    --bs-btn-active-bg: var(--bs-body-bg);
    --bs-btn-active-border-color: var(--bs-secondary-color);
}

.card {
    --bs-card-border-color: var(--bs-border-color);
    --bs-card-border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(16, 42, 54, .05);
}

.badge {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .01em;
}

.text-bg-success {
    background-color: var(--succ-bg) !important;
    color: var(--succ) !important;
}

.text-bg-warning {
    background-color: var(--warn-bg) !important;
    color: var(--warn) !important;
}

.list-group-item {
    border-color: var(--bs-border-color);
}

/*
 * Icon-Badge + Titel/Subtitle + Chevron-Zeile - die im Redesign
 * durchgaengige Listen-/Menuezeile (Dashboard-Kacheln, Kartenliste,
 * Profil-Menue). Baut auf dem bestehenden .list-group-item auf, kein
 * komplett neues Komponentensystem.
 */
.icon-badge {
    width: 44px;
    height: 44px;
    border-radius: .75rem;
    background: var(--primary-50);
    color: var(--primary-700);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.icon-badge.icon-badge-muted {
    background: #EEF2F4;
    color: #8B979C;
}

/* Kleinere Variante fuer dichte Menuelisten (Adminbereich-Mockup). */
.icon-badge.icon-badge-sm {
    width: 34px;
    height: 34px;
    border-radius: .625rem;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: none;
}

.list-row .list-row-body {
    flex: 1 1 auto;
    min-width: 0;
}

.list-row .list-row-title {
    font-weight: 600;
    font-size: .95rem;
    display: block;
}

.list-row .list-row-subtitle {
    font-size: .8125rem;
    color: var(--bs-secondary-color);
    display: block;
}

.list-row .chevron {
    flex: none;
    color: var(--bs-secondary-color);
}

/* Runder Avatar-Ring (Profil-Header). */
.avatar-ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--primary-100);
    border: 3px solid var(--primary-500);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-700);
}

/* Stat-Kachel (Fangbuch-Uebersicht). */
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-tile .stat-tile-label {
    font-size: .75rem;
    color: var(--bs-secondary-color);
}

.stat-tile .stat-tile-value {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 1.6rem;
    color: var(--primary-700);
}

/*
 * Mitgliederverwaltung (design-drafts/Mitgliederverwaltung - Desktop/Mobil):
 * rounded/bordered table card for the desktop row layout, plus a couple of
 * small badge modifiers shared with the mobile card layout of the same
 * data. Both layouts are rendered together and toggled with Bootstrap's
 * d-none/d-md-* utilities - see admin/members/index.php.
 */
.table-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--surface);
}

.table-card table {
    --bs-table-border-color: var(--bs-border-color);
    margin-bottom: 0;
}

.table-card thead th {
    background: var(--primary-50);
    color: var(--primary-700);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .02em;
    border-bottom: 1px solid var(--bs-border-color);
}

.member-self {
    background: var(--primary-50) !important;
}

.member-self.card {
    --bs-card-border-color: var(--primary-200);
}

.badge-you {
    background: var(--primary-600);
    color: #fff;
}

.badge-outline-primary {
    background: var(--surface);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
}

.badge-number {
    background: var(--primary-50);
    color: var(--primary-700);
}
