/* HAW Hamburg Corporate Design — ICC login/app stylesheet.
   Colors, typography and layout follow the HAW Corporate Design Manual 5.0. */

@font-face {
  font-family: "Open Sans";
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/OpenSans-Light.ttf") format("truetype");
}
@font-face {
  font-family: "Open Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/OpenSans-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Open Sans";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/OpenSans-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Martel";
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/Martel-Heavy.ttf") format("truetype");
}

:root {
  --hauptblau: #144e9b;
  --mittelblau: #0098d5;
  --hellblau: #9dc0df;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: #e2e6ea;
  --bg-soft: #f5f7fa;
  --radius: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Open Sans", system-ui, sans-serif;
  font-weight: 300;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
  text-align: left;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

a {
  color: var(--mittelblau);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Martel Heavy for the main headline, per CD. */
.headline {
  font-family: "Martel", Georgia, serif;
  font-weight: 900;
  color: var(--hauptblau);
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.headline.on-blue {
  color: #fff;
}

/* Balkenelement: signature accent bar used as a short underline. */
.balken {
  display: block;
  width: 56px;
  height: 5px;
  margin: 0.85rem 0 1.4rem;
  background: var(--hauptblau);
}
.balken.on-blue {
  background: #fff;
}

/* Einrichtung naming per CD: parent bold uppercase, sub-unit regular. */
.einrichtung {
  margin: 0;
}
.einrichtung .parent {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.25;
}
.einrichtung .unit {
  display: block;
  font-weight: 400;
}

.btn-primary {
  display: inline-block;
  border: 0;
  border-radius: var(--radius);
  background: var(--hauptblau);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover {
  background: #0f3d7a;
  text-decoration: none;
}

.btn-link {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--mittelblau);
  cursor: pointer;
}
.btn-link:hover {
  text-decoration: underline;
}

/* ---------- Login: split screen ---------- */

.login-split {
  display: grid;
  grid-template-columns: 5fr 6fr;
  min-height: 100vh;
}

.brand-panel {
  background: linear-gradient(150deg, var(--hauptblau) 0%, #0f6bb0 65%, var(--mittelblau) 100%);
  color: #fff;
  padding: clamp(2rem, 5vw, 4.5rem);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.brand-panel .logo {
  width: 220px;
  max-width: 60%;
  height: auto;
}
.brand-panel .brand-body {
  margin-top: auto;
}
.brand-panel .einrichtung {
  font-size: 1.15rem;
}
.brand-panel .claim {
  font-family: "Martel", Georgia, serif;
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1.2;
  margin-top: 1.6rem;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
}
.login-card {
  width: 100%;
  max-width: 430px;
}
.login-card .info {
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.login-card .hint {
  margin-bottom: 1.75rem;
}
.login-card .doc-link {
  display: inline-block;
  margin: 0 0 1.5rem;
}
.notice-error {
  background: #fdecec;
  border-left: 4px solid #c0392b;
  color: #8a2620;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

@media (max-width: 820px) {
  .login-split {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    gap: 1.5rem;
  }
  .brand-panel .brand-body {
    margin-top: 0;
  }
}

/* ---------- App shell (post-login) ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar-brand .logo {
  height: 42px;
  width: auto;
}
.topbar-brand .einrichtung {
  font-size: 0.72rem;
  color: var(--hauptblau);
  line-height: 1.3;
}
.topbar-brand .einrichtung .unit {
  color: var(--muted);
}
/* User area sits out of focus: muted, right-aligned. */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.topbar-user .name {
  font-weight: 700;
  color: var(--ink);
}
.topbar-user .haw-account {
  white-space: nowrap;
}

.app-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.app-nav a {
  padding: 0.85rem 1.1rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.app-nav a:hover {
  text-decoration: none;
  color: var(--hauptblau);
}
.app-nav a.active {
  color: var(--hauptblau);
  border-bottom-color: var(--hauptblau);
}

.app-main {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 4rem;
}
.lead {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Kubeconfig view */
.download-row {
  margin: 1.5rem 0 2.5rem;
}
.download-note {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.subhead {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--hauptblau);
  font-size: 0.95rem;
  margin: 2rem 0 0.75rem;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.5rem 3rem;
  border-left: 2px solid var(--line);
  margin-left: 1rem;
}
.steps > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -1.05rem;
  top: -0.1rem;
  width: 2rem;
  height: 2rem;
  background: var(--hauptblau);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.steps .step-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

code {
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: 0.88em;
}
pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  margin: 0.6rem 0;
}
pre code {
  color: var(--ink);
}

/* Tables — hairline rows, label-type headers in muted, roomy cells (DESIGN.md). */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
/* Header cells: column headers (thead) and key/value row headers. `label` token. */
.data-table thead th,
.data-table th[scope="row"] {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
/* Key/value layout: the left row-header column carries the label. */
.data-table th[scope="row"] {
  width: 40%;
}
.data-table td {
  word-break: break-word;
}

/* Resources / quota usage table */
.usage-table td {
  width: auto;
}
.usage-table td:last-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.usage-bar {
  flex: 1;
  min-width: 80px;
  height: 8px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.usage-fill {
  height: 100%;
  background: var(--mittelblau);
}
.usage-pct {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Debug: access matrix — resource rows × verb columns, allow/deny cells. */
.access-matrix {
  font-size: 0.82rem;
}
.access-matrix thead th {
  white-space: nowrap;
}
.access-matrix .row-key {
  white-space: nowrap;
  font-weight: 700;
}
.access-matrix .cell-yes,
.access-matrix .cell-no,
.access-matrix .cell-partial {
  text-align: center;
  font-weight: 700;
}
.access-matrix td[title] {
  cursor: help;
}
.cell-yes {
  color: #2e7d32;
}
.cell-no {
  color: #c0392b;
}
.cell-partial {
  color: #b8860b;
}

/* Debug: provisioning log */
.debug-log {
  list-style: none;
  padding: 0;
  margin: 0;
}
.debug-log li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.log-level {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius);
  color: #fff;
  background: var(--muted);
}
.log-info .log-level {
  background: var(--mittelblau);
}
.log-warn .log-level {
  background: #b8860b;
}
.log-error .log-level {
  background: #8a2620;
}
.log-msg {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.45;
}
