/* ==========================================================================
   VPN-Portal — App-Styles (aufbauend auf dem Mahr Software Design System)
   Bildet die Design-Bausteine aus VPN Portal.dc.html als Klassen nach.
   ========================================================================== */

body { margin: 0; background: var(--surface-page); color: var(--text-body); font-family: var(--font-sans); }
a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--brand-active); text-decoration: underline; }

@keyframes vpnFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- Layout-Grundgerüst -------------------------------------------------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.app-body { flex: 1; display: flex; align-items: stretch; }
.main { flex: 1; min-width: 0; padding: 32px 36px 56px; display: flex; flex-direction: column; gap: 24px; }

/* ---- Header -------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; height: 64px;
  background: color-mix(in srgb, var(--surface-card) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-subtle);
}
.topbar .logo { height: 20px; width: auto; }
.topbar .divider { width: 1px; height: 22px; background: var(--border-subtle); }
.topbar .app-name { font-size: var(--text-sm); font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); }
.spacer { flex: 1; }

.user-box { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--border-subtle); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 999px; background: var(--ink); color: #fff; font-size: var(--text-xs); font-weight: 700; flex: none;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta .name { font-size: var(--text-xs); font-weight: 600; color: var(--text-strong); }
.user-meta .mail { font-size: var(--text-2xs); color: var(--text-muted); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card);
  color: var(--text-muted); cursor: pointer; transition: var(--transition-base);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-strong); }

/* ---- Segmented control (Toggles) ---------------------------------------- */
.segmented {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-full);
}
.segmented.sq { border-radius: var(--radius-md); }
.seg-btn {
  border: none; background: none; cursor: pointer; font-family: var(--font-sans);
  font-size: var(--text-xs); font-weight: 600; color: var(--text-muted);
  padding: 6px 12px; border-radius: var(--radius-full); transition: var(--transition-base);
}
.segmented.sq .seg-btn { border-radius: var(--radius-sm); }
.seg-btn:hover { color: var(--text-strong); }
.seg-btn.active { background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-xs); }

/* ---- Sidebar ------------------------------------------------------------- */
.sidebar {
  width: 236px; flex: none; padding: 20px 14px; border-right: 1px solid var(--border-subtle);
  background: var(--surface-card); display: flex; flex-direction: column; gap: 4px;
}
.nav-label { padding: 6px 10px 8px; font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-subtle); }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: none;
  border-radius: var(--radius-md); font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600;
  text-align: left; cursor: pointer; background: none; color: var(--text-body); transition: var(--transition-base);
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-strong); text-decoration: none; }
.nav-item.active { background: var(--brand-subtle); color: var(--brand-active); }
.help-box { padding: 14px; border-radius: var(--radius-md); background: var(--surface-sunken); display: flex; flex-direction: column; gap: 6px; }
.help-box .h { font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-subtle); }
.help-box p { font-size: var(--text-xs); line-height: 1.55; color: var(--text-muted); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: var(--text-sm);
  border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer;
  padding: 0 16px; height: var(--control-md); white-space: nowrap; transition: var(--transition-base); text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--lg { height: var(--control-lg); font-size: var(--text-base); padding: 0 20px; }
.btn--sm { height: var(--control-sm); font-size: var(--text-xs); padding: 0 12px; }
.btn--full { width: 100%; }
.btn--solid { background: var(--brand); color: var(--text-on-brand); box-shadow: var(--shadow-xs); }
.btn--solid:hover { background: var(--brand-hover); color: #fff; }
.btn--solid:active { background: var(--brand-active); }
.btn--outline { background: var(--surface-card); color: var(--text-strong); border-color: var(--border-default); }
.btn--outline:hover { background: var(--surface-hover); color: var(--text-strong); }
.btn--ghost { background: none; color: var(--text-body); }
.btn--ghost:hover { background: var(--surface-hover); color: var(--text-strong); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---- Karten & Flächen ---------------------------------------------------- */
.card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card--pad { padding: 24px; gap: 16px; }
.card--link { cursor: pointer; transition: box-shadow var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard); }
.card--link:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.tile-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--text-strong);
}

/* ---- Überschriften / Seitenkopf ----------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--text-strong); }
.page-sub { font-size: var(--text-sm); color: var(--text-muted); }
.h-card { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); }

/* ---- Badges / Status-Pills ---------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-2xs); font-weight: 600; border-radius: var(--radius-full); padding: 5px 9px; }
.pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pill--success { color: var(--success); background: var(--success-subtle); }
.pill--danger  { color: var(--danger);  background: var(--danger-subtle); }
.pill--warning { color: var(--warning-700, var(--amber-700)); background: var(--warning-subtle); }
.pill--muted   { color: var(--text-muted); background: var(--surface-sunken); }
.badge-brand { font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.06em; color: var(--brand-active); background: var(--brand-subtle); border: 1px solid var(--brand-border); border-radius: var(--radius-full); padding: 4px 9px; }
.badge-muted { font-size: var(--text-2xs); font-weight: 600; color: var(--text-body); background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-full); padding: 4px 9px; }
.chip-mono { font-family: var(--font-mono); font-size: var(--text-2xs); font-weight: 600; color: var(--text-body); background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-full); padding: 4px 10px; }

/* ---- Grids --------------------------------------------------------------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.strong { color: var(--text-strong); }

/* ---- Tabellen ------------------------------------------------------------ */
.table-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow-x: auto; }
.t-head, .t-row { display: grid; gap: 14px; align-items: center; padding: 13px 20px; }
.t-head { background: var(--surface-sunken); border-bottom: 1px solid var(--border-subtle); font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-subtle); }
.t-row { border-bottom: 1px solid var(--border-subtle); }
.t-row:last-child { border-bottom: none; }

/* ---- Key/Value + Info-Leisten ------------------------------------------- */
.identity-bar { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 16px 20px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { font-size: var(--text-xs); color: var(--text-muted); flex: none; }
.kv-row .v { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; color: var(--text-strong); text-align: right; word-break: break-all; }

/* ---- Alert --------------------------------------------------------------- */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid; }
.alert .body { display: flex; flex-direction: column; gap: 2px; }
.alert .title { font-size: var(--text-sm); font-weight: 700; }
.alert .text { font-size: var(--text-xs); line-height: 1.55; }
.alert--info { background: var(--info-subtle); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--text-body); }
.alert--info .title { color: var(--info); }

/* ---- Login --------------------------------------------------------------- */
.login-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; padding: 40px 20px;
  background: linear-gradient(180deg, var(--brand-subtle) 0%, var(--surface-page) 46%);
}
.login-logo { height: 30px; width: auto; }
.login-card {
  width: 100%; max-width: 440px; background: var(--surface-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 36px 32px 28px; animation: vpnFade 240ms var(--ease-standard);
}
.sso-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-2xs); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-active); background: var(--brand-subtle);
  border: 1px solid var(--brand-border); border-radius: var(--radius-full); padding: 5px 10px;
}
.login-title { margin-top: 20px; font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--text-strong); }
.login-sub { margin: 8px 0 26px; font-size: var(--text-sm); line-height: 1.6; color: var(--text-muted); }
.login-hint { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-subtle); }
.login-hint p { font-size: var(--text-xs); line-height: 1.6; color: var(--text-subtle); }

/* ---- Formulare ----------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); }
.field > span code { font-weight: 500; }
.inp {
  font-family: var(--font-sans); font-size: var(--text-sm); color: var(--text-strong);
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  padding: 9px 12px; width: 100%; transition: var(--transition-base);
}
.inp:focus { outline: none; border-color: var(--border-focus); box-shadow: var(--ring); }
textarea.inp { resize: vertical; font-family: var(--font-mono); font-size: var(--text-xs); }
input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }

/* ---- Icons --------------------------------------------------------------- */
.i { width: 18px; height: 18px; flex: none; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 820px) {
  .sidebar { display: none; }
  .main { padding: 20px 16px 40px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .hide-sm { display: none; }
}
