:root {
  --bg: #0b1520;
  --panel: #121f2e;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8eef6;
  --muted: #93a8bf;
  --accent: #00aeef;
  --input-bg: #0b1520;
  --input-border: #335;
}

html[data-theme='light'] {
  --bg: #eef3f8;
  --panel: #ffffff;
  --line: rgba(18, 32, 51, 0.1);
  --text: #122033;
  --muted: #5b6d82;
  --accent: #0077b6;
  --input-bg: #fff;
  --input-border: #c9d6e3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Manrope, "PT Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hub-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.hub-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  padding: 4px;
}

.hub-brand strong {
  display: block;
  letter-spacing: 0.06em;
}

.hub-brand span {
  color: var(--muted);
  font-size: 12px;
}

.hub-main {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.hub-mod {
  display: block;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.hub-mod:hover {
  border-color: rgba(0, 174, 239, 0.55);
  transform: translateY(-1px);
}

.hub-mod b { display: block; margin-bottom: 6px; font-size: 17px; }
.hub-mod small { color: var(--muted); }

.hub-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 18px;
  margin-top: 20px;
}

.hub-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.hub-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 120px 140px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.hub-row:last-child { border-bottom: 0; }

.hub-btn,
.hub-top button {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #00aeef, #0077b6);
  color: #fff;
  font-weight: 600;
}

.hub-top button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.hub-muted { color: var(--muted); font-size: 13px; }

.hub-error {
  color: #ff8f8f;
  margin: 0 0 12px;
}

input[type="checkbox"] { width: 16px; height: 16px; }

.hub-row input[type="text"],
.hub-row input:not([type]) {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 0 10px;
}

.sap-theme-toggle {
  margin-top: 12px;
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #d5e0ea;
  background: #fff;
  color: #3d5168;
  cursor: pointer;
  font-weight: 600;
}

html[data-theme='light'] .sap-landing {
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(0, 174, 239, 0.14), transparent 55%),
    linear-gradient(165deg, #e8eef5 0%, #f7fafc 42%, #eef3f8 100%);
  color: #122033;
}

html[data-theme='light'] .sap-landing-lead,
html[data-theme='light'] .sap-landing-brand span,
html[data-theme='light'] .sap-landing-host {
  color: #5b6d82;
}

html[data-theme='light'] .sap-landing-copy h2,
html[data-theme='light'] .sap-landing-brand h1 {
  color: #122033;
}

.hub-tabs {
  display: flex;
  gap: 8px;
  margin: 28px 0 14px;
}

.hub-tabs button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.hub-tabs button.active {
  background: linear-gradient(135deg, #00aeef, #0077b6);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.hub-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.hub-panel-head h2 {
  margin: 0;
}

.hub-toolbar {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.hub-toolbar input,
.hub-toolbar select,
.hub-form-grid input,
.hub-form-grid select,
.hub-row input {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 0 10px;
}

.hub-table {
  display: grid;
  gap: 0;
}

.hub-table-row {
  display: grid;
  grid-template-columns: 1.3fr 1.2fr 1fr 1fr 90px 110px;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.hub-table-row.head {
  color: var(--muted);
  font-weight: 600;
  border-bottom-width: 2px;
}

.hub-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 174, 239, 0.2);
  color: var(--accent);
  font-size: 11px;
}

.hub-ok { color: #3ecf8e; }
.hub-bad { color: #ff8f8f; }
.hub-notice {
  color: #3ecf8e;
  margin: 0 0 10px;
}

.hub-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.hub-modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}

.hub-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hub-modal-head h3 { margin: 0; }

.hub-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hub-form-grid label,
.hub-form-flags label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.hub-form-flags {
  display: flex;
  gap: 18px;
  margin: 14px 0;
}

.hub-form-flags label {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
}

.hub-form-modules h4 {
  margin: 8px 0 10px;
  font-size: 14px;
}

.hub-mod-access {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.hub-mod-access small { color: var(--muted); }
.hub-inline {
  display: inline-flex !important;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.hub-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .hub-table-row,
  .hub-table-row.head {
    grid-template-columns: 1fr;
  }
  .hub-toolbar {
    grid-template-columns: 1fr;
  }
  .hub-form-grid {
    grid-template-columns: 1fr;
  }
}
