/* ============================================================
   Staubli Capital Management – Portal- und Verwaltungsbereich
   Palette: Swiss Graphite & Red (siehe style.css)
   ============================================================ */

.portal-body {
  background: var(--color-bg-alt, #F1F3F5);
}

/* ---------- Devisenleiste ---------- */
.fx-bar {
  background: #111827;
  color: #E5E7EB;
  font-size: .82rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
}

.fx-bar__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: .45rem 1.25rem;
}

.fx-bar__label {
  flex: 0 0 auto;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem;
  color: #9CA3AF;
  border-right: 1px solid rgba(255, 255, 255, .14);
  padding-right: 1rem;
  white-space: nowrap;
}

.fx-bar__time {
  flex: 0 0 auto;
  color: #6B7280;
  font-size: .7rem;
  white-space: nowrap;
}

.fx-track {
  flex: 1 1 auto;
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.fx-track::-webkit-scrollbar { display: none; }

.fx-item {
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
  font-variant-numeric: tabular-nums;
}

.fx-item__pair { color: #9CA3AF; font-size: .74rem; letter-spacing: .04em; }
.fx-item__rate { font-weight: 600; color: #F9FAFB; }
.fx-item__delta { font-size: .72rem; }
.fx-item__delta--up   { color: #34D399; }
.fx-item__delta--down { color: #F87171; }
.fx-item__delta--flat { color: #9CA3AF; }

/* ---------- Kopfbereich ---------- */
.portal-header {
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.portal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: .9rem 1.25rem;
}

.portal-header__user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.portal-user { text-align: right; line-height: 1.25; }
.portal-user__name { display: block; font-weight: 600; font-size: .94rem; color: #111827; }
.portal-user__meta { display: block; font-size: .76rem; color: #6B7280; }

.logo__sub {
  display: block;
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-accent, #D8232A);
}

/* ---------- Portalnavigation ---------- */
.portal-nav {
  border-top: 1px solid #E5E7EB;
  background: #F9FAFB;
}

.portal-nav__inner {
  display: flex;
  gap: .25rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.portal-nav__inner::-webkit-scrollbar { display: none; }

.portal-nav__link {
  display: inline-block;
  padding: .8rem .95rem;
  font-size: .9rem;
  font-weight: 500;
  color: #3E4C59;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.portal-nav__link:hover { color: #111827; background: #fff; }

.portal-nav__link.is-active {
  color: var(--color-accent, #D8232A);
  border-bottom-color: var(--color-accent, #D8232A);
  background: #fff;
}

.portal-nav__link--out { margin-left: auto; color: #6B7280; }

/* ---------- Layout ---------- */
.portal-main { padding: 2rem 0 3.5rem; }

.portal-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.portal-page-head { margin-bottom: 1.6rem; }
.portal-page-head h1 { font-size: 1.72rem; margin: 0 0 .35rem; color: #111827; }
.portal-page-head p { margin: 0; color: #6B7280; font-size: .95rem; }

/* ---------- Kennzahlenkarten ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.kpi {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--color-accent, #D8232A);
}

.kpi--muted::before { background: #9CA3AF; }
.kpi--dark { background: #1F2933; border-color: #1F2933; }
.kpi--dark .kpi__label { color: #9CA3AF; }
.kpi--dark .kpi__value { color: #fff; }
.kpi--dark .kpi__hint  { color: #9CA3AF; }

.kpi__label {
  display: block;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #6B7280;
  margin-bottom: .4rem;
}

.kpi__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.kpi__hint { display: block; margin-top: .35rem; font-size: .78rem; color: #6B7280; }

/* ---------- Karten und Tabellen ---------- */
.portal-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.portal-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #E5E7EB;
}

.portal-card__head h2,
.portal-card__head h3 { margin: 0; font-size: 1.05rem; color: #111827; }
.portal-card__body { padding: 1.25rem; }
.portal-card__body--flush { padding: 0; }

.table-scroll { overflow-x: auto; }

table.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

table.portal-table th,
table.portal-table td {
  padding: .7rem .85rem;
  text-align: left;
  border-bottom: 1px solid #F1F3F5;
  vertical-align: top;
}

table.portal-table thead th {
  background: #1F2933;
  color: #fff;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: none;
}

table.portal-table tbody tr:hover { background: #F9FAFB; }
table.portal-table tbody tr:last-child td { border-bottom: none; }
table.portal-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.portal-table .strong { font-weight: 600; color: #111827; }
table.portal-table tfoot td {
  background: #F1F3F5;
  font-weight: 700;
  border-top: 2px solid #1F2933;
  border-bottom: none;
}

/* ---------- Abzeichen ---------- */
.pill {
  display: inline-block;
  padding: .18rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
}

.pill--aktiv      { background: #DCFCE7; color: #166534; }
.pill--faellig    { background: #FEF3C7; color: #92400E; }
.pill--beendet    { background: #E5E7EB; color: #4B5563; }
.pill--vorgemerkt { background: #DBEAFE; color: #1E40AF; }
.pill--gesperrt   { background: #FEE2E2; color: #991B1B; }
.pill--inaktiv    { background: #E5E7EB; color: #4B5563; }
.pill--produkt    { background: #1F2933; color: #fff; }
.pill--waehrung   { background: #F1F3F5; color: #3E4C59; border: 1px solid #E5E7EB; }

/* ---------- Fortschritt ---------- */
.progress {
  display: block;
  height: 6px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
  min-width: 90px;
}

.progress__bar {
  display: block;
  height: 100%;
  background: var(--color-accent, #D8232A);
  border-radius: 999px;
}

/* ---------- Anmeldung ---------- */
.portal-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #1F2933;
}

.portal-login__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
}

.portal-login__card {
  width: 100%;
  max-width: 960px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.portal-login__visual {
  background: linear-gradient(155deg, #1F2933 0%, #3E4C59 100%);
  color: #fff;
  padding: 2.4rem 2.2rem;
}

.portal-login__visual h2 { color: #fff; margin: .5rem 0 1rem; font-size: 1.5rem; }
.portal-login__form { padding: 2.4rem 2.2rem; }

/* ---------- Datenlisten ---------- */
.data-list { margin: 0; }

.data-list__row {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: .75rem;
  padding: .62rem 0;
  border-bottom: 1px solid #F1F3F5;
  font-size: .9rem;
}

.data-list__row:last-child { border-bottom: none; }
.data-list__label { color: #6B7280; }
.data-list__value { color: #111827; font-weight: 500; }

/* ---------- Zeitleiste Fälligkeiten ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  position: relative;
  padding: 0 0 1.1rem 1.5rem;
  border-left: 2px solid #E5E7EB;
  margin-left: .35rem;
}

.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: .3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent, #D8232A);
  border: 2px solid #fff;
}

.timeline__date { display: block; font-size: .76rem; color: #6B7280; }
.timeline__title { font-weight: 600; color: #111827; font-size: .92rem; }
.timeline__meta { display: block; font-size: .82rem; color: #6B7280; }

/* ---------- Hinweise ---------- */
.portal-alert {
  border-radius: 8px;
  padding: .9rem 1.1rem;
  font-size: .9rem;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
}

.portal-alert--info    { background: #EFF6FF; border-color: #BFDBFE; color: #1E3A8A; }
.portal-alert--ok      { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.portal-alert--warn    { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.portal-alert--error   { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

/* ---------- Verwaltung ---------- */
.admin-badge {
  display: inline-block;
  background: var(--color-accent, #D8232A);
  color: #fff;
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 4px;
  margin-left: .5rem;
  vertical-align: middle;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.admin-search {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.admin-search input,
.admin-search select {
  padding: .5rem .7rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: .88rem;
  background: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.form-grid .field--wide { grid-column: 1 / -1; }

.portal-body .field label,
.portal-login .field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: #3E4C59;
  margin-bottom: .3rem;
}

.portal-body .field input,
.portal-body .field select,
.portal-body .field textarea,
.portal-login .field input {
  width: 100%;
  padding: .62rem .75rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: .92rem;
  font-family: inherit;
  background: #fff;
  color: #111827;
}

.portal-body .field input:focus,
.portal-body .field select:focus,
.portal-body .field textarea:focus,
.portal-login .field input:focus {
  outline: none;
  border-color: var(--color-accent, #D8232A);
  box-shadow: 0 0 0 3px rgba(216, 35, 42, .12);
}

.portal-body .field { margin-bottom: 1rem; }
.field__hint { display: block; font-size: .76rem; color: #6B7280; margin-top: .25rem; }

.actions-inline {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
  min-width: 150px;
}

.actions-inline form { display: inline-flex; margin: 0; }
.actions-inline .btn { white-space: nowrap; }

.btn--sm { padding: .35rem .7rem; font-size: .8rem; }
.btn--danger { background: #991B1B; color: #fff; border-color: #991B1B; }
.btn--danger:hover { background: #7F1D1D; }

/* ---------- Passwortliste in der Verwaltung ---------- */
code.pw {
  background: #F1F3F5;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: .1rem .35rem;
  font-size: .82rem;
  color: #991B1B;
}

/* ---------- Fußbereich ---------- */
.portal-footer {
  background: #1F2933;
  color: #9CA3AF;
  padding: 2rem 0 1.25rem;
  font-size: .86rem;
}

.portal-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.portal-footer strong { color: #fff; }
.portal-footer .muted { color: #9CA3AF; margin: .4rem 0 0; font-size: .82rem; }

.portal-footer__title {
  display: block;
  color: #fff;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .6rem;
}

.portal-footer__list { list-style: none; margin: 0; padding: 0; }
.portal-footer__list li { margin-bottom: .35rem; }
.portal-footer__list a { color: #D1D5DB; text-decoration: none; }
.portal-footer__list a:hover { color: #fff; text-decoration: underline; }

.portal-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  font-size: .78rem;
  color: #6B7280;
  flex-wrap: wrap;
}

/* ---------- Diagramm (reines CSS) ---------- */
.bar-chart { display: grid; gap: .7rem; }

.bar-chart__row {
  display: grid;
  grid-template-columns: 130px 1fr 120px;
  align-items: center;
  gap: .75rem;
  font-size: .86rem;
}

.bar-chart__label { color: #3E4C59; }

.bar-chart__track {
  display: block;
  background: #F1F3F5;
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}

.bar-chart__fill {
  display: block;
  height: 100%;
  min-width: 2px;
  background: #1F2933;
  border-radius: 4px;
}

.bar-chart__fill--festgeld       { background: #1F2933; }
.bar-chart__fill--tagesgeld      { background: #3E4C59; }
.bar-chart__fill--firmenfestgeld { background: #D8232A; }
.bar-chart__fill--kinderfestgeld { background: #6B7280; }

.bar-chart__value { text-align: right; font-variant-numeric: tabular-nums; color: #111827; font-weight: 600; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .portal-login__card { grid-template-columns: 1fr; }
  .portal-login__visual { padding: 1.8rem 1.5rem; }
  .portal-login__form { padding: 1.8rem 1.5rem; }
  .portal-footer__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .bar-chart__row { grid-template-columns: 100px 1fr 96px; font-size: .8rem; }
}

@media (max-width: 700px) {
  .fx-bar__label, .fx-bar__time { display: none; }
  .portal-header__inner { flex-wrap: wrap; gap: .75rem; }
  .portal-user { text-align: left; }
  .data-list__row { grid-template-columns: 1fr; gap: .15rem; }
  .kpi__value { font-size: 1.3rem; }
}
