/* ==========================================================================
   User-Panel – baut auf /assets/ls-design.css auf (Tokens, Buttons, Header)
   ========================================================================== */

.up-main { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* Layout: Seitenleiste + Inhalt */
.up-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: clamp(28px, 5vw, 56px); }
.up-side { position: sticky; top: calc(var(--header-h) + 20px); }
.up-side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; }
.up-content { display: grid; gap: 20px; min-width: 0; }

.up-me { display: flex; align-items: center; gap: 12px; padding: 4px 4px 16px; border-bottom: 1px solid var(--line); }
.up-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); object-fit: cover; flex-shrink: 0; }
.up-me-text { min-width: 0; }
.up-me-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-me-sub { font-size: 14px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.up-side-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 18px 6px 8px; }

.up-menu, .up-chars { display: grid; gap: 2px; }
.up-menu a, .up-chars a, .up-logout button {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--r-sm);
    color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
    transition: background .15s, color .15s;
}
.up-menu a:hover, .up-chars a:hover, .up-logout button:hover { background: var(--surface-2); color: var(--ink); }
.up-menu a[aria-current="page"] { background: var(--surface-3); color: var(--ink); box-shadow: inset 3px 0 0 var(--red); }
.up-chars a[aria-current="true"] { color: var(--ink); background: var(--surface-2); }
.up-chars a[aria-current="true"]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--online); flex-shrink: 0; }
.up-menu svg, .up-logout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.up-menu span { flex: 1; }
.up-menu em { font-style: normal; font-size: 12px; font-weight: 600; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.up-menu a[aria-current="page"] em { background: var(--bg); }
.up-menu em.alert { background: var(--red-soft); color: #FF8A7E; }

.up-logout { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.up-logout button { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; }

.up-head h1 { font: 800 clamp(26px, 3.4vw, 38px)/1.15 var(--font-display); letter-spacing: -0.035em; }
.up-head p { color: var(--ink-2); margin-top: 6px; }

@media (max-width: 900px) {
    .up-layout { grid-template-columns: 1fr; gap: 20px; }
    .up-side { position: static; }
    .up-side-card { padding: 14px; }
    .up-side-label { display: none; }
    .up-me { padding-bottom: 12px; }
    .up-chars { display: flex; gap: 6px; overflow-x: auto; margin-top: 12px; }
    .up-chars a { white-space: nowrap; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font-size: 14px; }
    .up-menu { display: flex; gap: 4px; overflow-x: auto; margin: 12px -4px 0; padding: 0 4px 2px; scrollbar-width: none; }
    .up-menu::-webkit-scrollbar { display: none; }
    .up-menu a { white-space: nowrap; flex-shrink: 0; }
    .up-menu a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--red); }
    .up-logout { margin-top: 10px; padding-top: 10px; }
}

/* Karten */
.up-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px 26px; min-width: 0; }
.up-card h2 { font: 700 18px/1.3 var(--font-display); letter-spacing: -0.02em; margin-bottom: 16px; display: flex; align-items: baseline; gap: 10px; }
.up-card h2 small { font: 500 13px var(--font-body); color: var(--ink-3); letter-spacing: 0; }
.up-card h2 a { margin-left: auto; font: 500 14px var(--font-body); color: var(--ink-2); text-decoration: none; letter-spacing: 0; }
.up-card h2 a:hover { color: var(--ink); }
@media (max-width: 600px) { .up-card { padding: 20px 18px; } }

.up-login { max-width: 560px; }
.up-login p { color: var(--ink-2); margin-bottom: 22px; }
.up-discord { background: #5865F2; color: #fff; }
.up-discord:hover { background: #4752C4; color: #fff; }
.up-error { background: var(--red-soft); border: 1px solid rgba(255, 77, 61, .35); color: #FFB3AB; border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 20px; font-size: 15px; }

/* Kennzahlen */
.up-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.up-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; }
.up-stat-label { font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.up-stat-value { font: 700 22px/1.3 var(--font-display); letter-spacing: -0.02em; margin-top: 4px; overflow-wrap: anywhere; }
.up-stat-sub { font-size: 14px; color: var(--ink-2); }

.up-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .up-grid { grid-template-columns: 1fr; } }

.up-dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 10px 20px; font-size: 15px; }
.up-dl dt { color: var(--ink-3); }
.up-dl dd { color: var(--ink); overflow-wrap: anywhere; }

/* Tabellen */
.up-table-wrap { overflow-x: auto; margin: 0 -6px; }
.up-table-wrap + .up-table-wrap { margin-top: 20px; }
.up-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.up-table th { text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.up-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.up-table tr:last-child td { border-bottom: 0; }
.up-table td strong { color: var(--ink); font-weight: 600; }

.up-plate { font-family: ui-monospace, monospace; font-size: 14px; background: #F3F4F6; color: #0E0F12; padding: 2px 8px; border-radius: 4px; white-space: nowrap; font-weight: 600; }

.up-pill { display: inline-block; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.up-pill.ok   { background: rgba(47, 210, 122, .12); color: #7BE8AD; }
.up-pill.warn { background: var(--warn-soft); color: var(--warn); }
.up-pill.bad  { background: var(--red-soft); color: #FF8A7E; }
.up-pill.info { background: var(--blue-soft); color: #93c5fd; }

.up-bar { width: 80px; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.up-bar span { display: block; height: 100%; background: var(--online); }
.up-bar.mid span { background: var(--warn); }
.up-bar.low span { background: var(--red); }

.up-empty { color: var(--ink-3); font-size: 15px; }
.up-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* Fahrzeugkarten */
.up-veh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.up-veh { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; display: grid; gap: 14px; align-content: start; }
.up-veh-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.up-veh-name { font: 700 17px/1.3 var(--font-display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.up-veh-model { font-size: 14px; color: var(--ink-3); }
.up-veh .up-dl { font-size: 14px; gap: 8px 16px; grid-template-columns: auto 1fr; }
.up-veh-note { font-size: 13px; color: #FF8A7E; }

/* Kompakte Liste (Übersicht) */
.up-list { display: grid; }
.up-list > div { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.up-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.up-list > div:first-child { padding-top: 0; }
.up-list strong { color: var(--ink); font-weight: 600; }
.up-list .up-grow { flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Inventar */
.up-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.up-inv div { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.up-inv span { color: var(--ink-3); flex-shrink: 0; }
.up-search { width: 100%; max-width: 320px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 14px; color: var(--ink); font: inherit; font-size: 15px; margin-bottom: 16px; }
.up-search:focus { outline: none; border-color: var(--ink-3); }
