/* ================================================================
   AutoWerk Pro – Kundenportal CSS
   kunde.srk-service.de
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  --bg:         #f0f2f7;
  --bg2:        #ffffff;
  --bg3:        #e8ebf3;
  --border:     #d5daea;
  --text:       #151820;
  --text2:      #5b6280;
  --text3:      #9aa3bc;
  --acc:        #1a4fd6;
  --acc2:       #1340b8;
  --acc-light:  #e8effc;
  --green:      #0f7a3f;
  --green-bg:   #e8f5ee;
  --red:        #c0392b;
  --red-bg:     #fcecea;
  --orange:     #c05c00;
  --orange-bg:  #fff1e6;
  --blue-bg:    #e8effc;
  --sans:       'DM Sans', system-ui, sans-serif;
  --mono:       'DM Mono', monospace;
  --r:          12px;
  --shadow:     0 2px 16px rgba(21,24,32,.07);
  --shadow2:    0 8px 40px rgba(21,24,32,.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  font-family: var(--sans);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 10px 18px; border-radius: 9px; border: none;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; text-decoration: none;
  white-space: nowrap; line-height: 1;
}
.btn-primary   { background: var(--acc); color: #fff; }
.btn-primary:hover { background: var(--acc2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,79,214,.35); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost     { background: transparent; color: var(--acc); }
.btn-ghost:hover { background: var(--acc-light); }
.btn-danger    { background: var(--red-bg); color: var(--red); border: 1px solid #f5c6c2; }
.btn-success   { background: var(--green-bg); color: var(--green); border: 1px solid #b8dfc9; }
.btn-sm        { padding: 7px 13px; font-size: 12px; }
.btn-block     { width: 100%; justify-content: center; padding: 13px; }

/* ── Formulare ──────────────────────────────────────────────────── */
.form-group  { margin-bottom: 18px; }
.form-label  {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text2); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 7px;
}
.form-input {
  width: 100%; padding: 11px 15px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-family: var(--sans); font-size: 14px;
  color: var(--text); background: var(--bg);
  transition: border .15s, box-shadow .15s; outline: none;
}
.form-input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(26,79,214,.12); }
textarea.form-input { resize: vertical; min-height: 90px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert { padding: 11px 16px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; line-height: 1.4; }
.alert-err  { background: var(--red-bg);    color: var(--red);    border: 1px solid #f5c6c2; }
.alert-ok   { background: var(--green-bg);  color: var(--green);  border: 1px solid #b8dfc9; }
.alert-info { background: var(--blue-bg);   color: var(--acc2);   border: 1px solid #c5d8f7; }
.alert-warn { background: var(--orange-bg); color: var(--orange); border: 1px solid #f5d9b8; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px; white-space: nowrap;
}
.b-green  { background: var(--green-bg);  color: var(--green);  }
.b-red    { background: var(--red-bg);    color: var(--red);    }
.b-orange { background: var(--orange-bg); color: var(--orange); }
.b-blue   { background: var(--blue-bg);   color: var(--acc2);   }
.b-gray   { background: var(--bg3);       color: var(--text2);  }

/* ── Cards ──────────────────────────────────────────────────────── */
.card          { background: var(--bg2); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; }
.card-header   { padding: 16px 22px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: space-between; }
.card-body     { padding: 22px; }
.card-body.no-pad { padding: 0; }

/* ── Tabellen ───────────────────────────────────────────────────── */
.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt th {
  background: var(--bg3); padding: 10px 16px;
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text2); white-space: nowrap;
}
.dt td { padding: 12px 16px; border-bottom: 1px solid var(--bg3); vertical-align: middle; }
.dt tr:last-child td { border-bottom: none; }
.dt tr:hover td { background: #f7f9fd; }

/* ── KPI-Grid ───────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card { background: var(--bg2); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; }
.kpi-val  { font-size: 28px; font-weight: 700; font-family: var(--mono); line-height: 1; }
.kpi-lbl  { font-size: 11px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: 6px; }

/* ── Fahrzeugkarten ─────────────────────────────────────────────── */
.fz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.fz-card {
  background: var(--bg2); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 20px; cursor: pointer;
  border: 2px solid transparent; transition: all .2s;
}
.fz-card:hover, .fz-card.active {
  border-color: var(--acc); box-shadow: var(--shadow2); transform: translateY(-2px);
}
.kennzeichen {
  display: inline-block; background: #fff;
  border: 2.5px solid #1a1a1a; border-radius: 7px;
  padding: 5px 14px; font-weight: 800; font-size: 17px;
  font-family: var(--mono); letter-spacing: 1.5px; margin-bottom: 10px;
}
.fz-details      { font-size: 12px; color: var(--text2); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.fz-detail-chip  { background: var(--bg3); border-radius: 5px; padding: 2px 8px; }

/* ── Chat ───────────────────────────────────────────────────────── */
.chat-wrap {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px; max-height: 420px; overflow-y: auto;
}
.msg { max-width: 75%; padding: 11px 16px; border-radius: 14px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.msg-kunde     { background: var(--acc); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg-werkstatt { background: var(--bg3); color: var(--text); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg-meta      { font-size: 10px; opacity: .6; margin-top: 4px; }
.chat-input-area {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input-area textarea {
  flex: 1; border: 1.5px solid var(--border); border-radius: 9px;
  padding: 10px 14px; font-family: var(--sans); font-size: 13px;
  resize: none; outline: none; max-height: 120px; line-height: 1.5;
}
.chat-input-area textarea:focus { border-color: var(--acc); }

/* ── Profil Info-Grid ───────────────────────────────────────────── */
.info-grid { display: grid; grid-template-columns: 160px 1fr; }
.info-row { display: contents; }
.info-row .lbl { padding: 11px 16px; font-size: 12px; font-weight: 600; color: var(--text2); border-bottom: 1px solid var(--bg3); }
.info-row .val { padding: 11px 16px; font-size: 13px; border-bottom: 1px solid var(--bg3); }
.info-row:last-child .lbl,
.info-row:last-child .val { border-bottom: none; }

/* ── Kundenkarte ────────────────────────────────────────────────── */
.karte {
  background: linear-gradient(135deg, #0d1b4b 0%, #1a4fd6 100%);
  border-radius: 16px; padding: 28px; color: #fff;
  position: relative; overflow: hidden; max-width: 380px;
}
.karte::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.karte::after {
  content: ''; position: absolute; bottom: -60px; left: -20px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.04);
}

/* ── Spinner / Empty State ──────────────────────────────────────── */
.spinner-wrap { display: flex; justify-content: center; padding: 60px; }
.spinner {
  border: 3px solid var(--bg3); border-top-color: var(--acc);
  border-radius: 50%; width: 34px; height: 34px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text2); }
.empty-state .icon { font-size: 44px; margin-bottom: 14px; opacity: .5; }
.empty-state p { font-size: 14px; line-height: 1.5; }

/* ── Layout ─────────────────────────────────────────────────────── */
#portal { display: none; min-height: 100vh; flex-direction: column; }

.portal-header {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.portal-header .brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; color: var(--text); }
.hdr-right  { display: flex; align-items: center; gap: 12px; }
.hdr-user   { font-size: 13px; color: var(--text2); font-weight: 500; }
.hdr-badge  { background: var(--red); color: #fff; border-radius: 20px; padding: 2px 7px; font-size: 11px; font-weight: 700; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.7} }

.portal-body { display: flex; flex: 1; }

.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg2); border-right: 1px solid var(--border);
  padding: 20px 12px; min-height: calc(100vh - 58px);
}
.nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text3); padding: 4px 12px; margin: 14px 0 6px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  background: none; border: none; border-radius: 9px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  cursor: pointer; color: var(--text2); transition: all .15s; text-align: left;
}
.nav-btn:hover  { background: var(--bg3); color: var(--text); }
.nav-btn.active { background: var(--acc-light); color: var(--acc); font-weight: 600; }
.nav-btn .icon  { font-size: 16px; width: 22px; text-align: center; }
.nav-badge { background: var(--red); color: #fff; border-radius: 20px; padding: 1px 6px; font-size: 10px; font-weight: 700; margin-left: auto; }

.portal-main { flex: 1; padding: 28px; max-width: 900px; margin: 0 auto; width: 100%; min-width: 0; }

/* ── Mobile Navigation ──────────────────────────────────────────── */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2); border-top: 1px solid var(--border);
  z-index: 100; padding: 8px 0; justify-content: space-around;
}
.mnav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; padding: 6px 12px;
  cursor: pointer; color: var(--text2);
  font-family: var(--sans); font-size: 10px; font-weight: 600;
}
.mnav-btn.active { color: var(--acc); }
.mnav-btn .icon  { font-size: 20px; }

@media (max-width: 768px) {
  .sidebar        { display: none; }
  .portal-main    { padding: 16px 14px 80px; }
  .mobile-nav     { display: flex; }
  .portal-header  { padding: 0 16px; }
}

/* ── Login Screen ───────────────────────────────────────────────── */
#login-screen {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #0d1b4b 0%, #1a4fd6 60%, #2563eb 100%);
}
.login-card {
  background: var(--bg2); border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  padding: 44px 40px; width: 100%; max-width: 400px;
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand .wrench { font-size: 36px; margin-bottom: 10px; }
.login-brand h1 { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.4px; }
.login-brand p  { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: var(--bg2); border-radius: 18px; padding: 36px; width: 100%; max-width: 380px; box-shadow: var(--shadow2); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-sub   { font-size: 13px; color: var(--text2); margin-bottom: 22px; line-height: 1.5; }

/* ── Sonstiges ──────────────────────────────────────────────────── */
.separator { height: 1px; background: var(--border); margin: 20px 0; }
.page-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; letter-spacing: -.3px; }


/* ===== SRK Modern KFZ Theme ===== */
:root{
 --bg:#0f1115;
 --card:#181c24;
 --card2:#222938;
 --border:#30384a;
 --text:#f4f6fb;
 --muted:#aab3c2;
 --accent:#ff9800;
}

body{
 background:var(--bg)!important;
 color:var(--text)!important;
}

.card,.panel,.content-card,.widget{
 background:var(--card)!important;
 border:1px solid var(--border)!important;
 border-radius:18px!important;
 box-shadow:0 15px 40px rgba(0,0,0,.35)!important;
}

button,.btn-primary{
 background:linear-gradient(135deg,#ff9800,#e68900)!important;
 border:none!important;
 border-radius:12px!important;
}

table thead th{
 background:var(--card2)!important;
}

.kundenkarte-card,
.loyalty-card,
.customer-card{
 background:linear-gradient(135deg,#1b1f29,#32415d)!important;
 border-radius:24px!important;
 box-shadow:0 20px 60px rgba(0,0,0,.45)!important;
}
