:root {
  --hub-bg: #0f1419;
  --hub-bg-soft: #151b23;
  --hub-surface: #1c2430;
  --hub-surface-2: #243041;
  --hub-border: #334155;
  --hub-text: #f1f5f9;
  --hub-text-muted: #94a3b8;
  --hub-accent: #facc15;
  --hub-accent-hover: #fde047;
  --hub-accent-text: #1a1a1a;
  --hub-ok: #22c55e;
  --hub-ok-bg: rgba(34, 197, 94, 0.12);
  --hub-off: #64748b;
  --hub-off-bg: rgba(100, 116, 139, 0.16);
  --hub-error: #f87171;
  --hub-error-bg: rgba(248, 113, 113, 0.12);
  --hub-token-bg: rgba(250, 204, 21, 0.1);
  --hub-radius: 10px;
  --hub-radius-sm: 6px;
  --hub-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --hub-font: "Wix Madefor Display", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--hub-font);
  background: var(--hub-bg);
  color: var(--hub-text);
  line-height: 1.45;
}

a {
  color: var(--hub-accent);
}

a:hover {
  color: var(--hub-accent-hover);
}

button,
input {
  font: inherit;
}

/* Auth layout */

.hub-auth {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(250, 204, 21, 0.14), transparent 55%),
    linear-gradient(180deg, #0b1016 0%, var(--hub-bg) 100%);
}

.hub-auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.hub-auth-panel {
  width: 100%;
  max-width: 440px;
}

.hub-auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.hub-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--hub-accent);
  color: var(--hub-accent-text);
  font-weight: 700;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.hub-logo-mark-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1rem;
}

.hub-logo-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.hub-logo-sub {
  margin: 2px 0 0;
  color: var(--hub-text-muted);
  font-size: 0.92rem;
}

.hub-auth-note {
  margin: 16px 4px 0;
  color: var(--hub-text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.hub-auth-foot {
  margin: 18px 0 0;
  text-align: center;
  color: var(--hub-text-muted);
  font-size: 0.92rem;
}

.hub-link {
  color: var(--hub-accent);
  text-decoration: none;
  font-weight: 600;
}

.hub-link:hover {
  text-decoration: underline;
}

/* App shell */

.hub-app {
  background:
    radial-gradient(ellipse 70% 45% at 100% -5%, rgba(250, 204, 21, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(34, 197, 94, 0.05), transparent 45%),
    var(--hub-bg);
}

.hub-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--hub-border);
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(10px);
}

.hub-topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hub-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hub-text);
  text-decoration: none;
  font-weight: 700;
}

.hub-topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.hub-topbar-settings {
  font-size: 0.88rem;
}

.hub-tenant-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--hub-surface-2);
  border: 1px solid var(--hub-border);
  font-size: 0.85rem;
  font-weight: 600;
}

.hub-tenant-pill-link {
  color: var(--hub-text);
  text-decoration: none;
}

.hub-tenant-pill-link:hover {
  border-color: var(--hub-accent);
  color: var(--hub-text);
}

.hub-tenant-slug {
  color: var(--hub-text-muted);
  font-size: 0.85rem;
}

.hub-user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.hub-user-email {
  color: var(--hub-text-muted);
  font-size: 0.88rem;
}

.hub-topbar-back {
  margin-left: auto;
  font-size: 0.92rem;
}

.hub-main {
  padding: 28px 16px 48px;
}

.hub-main-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.hub-main-narrow .hub-main-inner {
  max-width: 560px;
}

.hub-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hub-page-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.hub-page-lead {
  margin: 8px 0 0;
  color: var(--hub-text-muted);
  max-width: 42rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.hub-stat {
  color: var(--hub-text-muted);
}

.hub-stat-ok {
  color: #86efac;
  font-weight: 600;
}

.hub-stat-sep {
  opacity: 0.45;
}

.hub-btn-compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.88rem;
}

/* Cards */

.hub-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  box-shadow: var(--hub-shadow);
  padding: 24px;
}

.hub-auth-card {
  padding: 28px 24px 24px;
}

.hub-card-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 700;
}

.hub-card-lead {
  margin: 0 0 20px;
  color: var(--hub-text-muted);
  font-size: 0.95rem;
}

/* Forms */

.hub-form {
  display: grid;
  gap: 16px;
}

.hub-field {
  display: grid;
  gap: 6px;
}

.hub-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--hub-text-muted);
}

.hub-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-sm);
  background: var(--hub-bg-soft);
  color: var(--hub-text);
}

.hub-input:focus {
  outline: 2px solid rgba(250, 204, 21, 0.45);
  outline-offset: 1px;
  border-color: var(--hub-accent);
}

.hub-hint {
  font-size: 0.8rem;
  color: var(--hub-text-muted);
}

.hub-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.hub-form-actions-main {
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
  padding-top: 4px;
}

.hub-btn-wide {
  min-width: 10.5rem;
}

.hub-edit-card {
  display: grid;
  gap: 0;
}

.hub-edit-head {
  margin-bottom: 18px;
}

.hub-edit-head .hub-card-lead {
  margin-bottom: 0;
}

.hub-edit-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--hub-border);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}

.hub-form + .hub-edit-section {
  border-top: none;
  padding-top: 0;
}

.hub-edit-section-head {
  flex: 1 1 14rem;
  display: grid;
  gap: 6px;
}

.hub-edit-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.hub-edit-section-action {
  margin: 0;
  flex: 0 0 auto;
  margin-left: auto;
  /* Polje lozinke (potvrda) iznad gumba. */
  display: grid;
  gap: 10px;
}

.hub-edit-section-danger {
  margin-top: 18px;
  padding-top: 16px;
}

.hub-edit-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--hub-border);
}

/* Settings */

.hub-settings {
  display: grid;
  gap: 16px;
}

.hub-settings-page-head {
  margin-bottom: 4px;
}

.hub-settings-panel {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  padding: 20px 20px 18px;
  display: grid;
  gap: 16px;
}

.hub-settings-panel-head {
  display: grid;
  gap: 4px;
  padding-bottom: 2px;
}

.hub-settings-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.hub-settings-panel-lead {
  margin: 0;
  color: var(--hub-text-muted);
  font-size: 0.88rem;
}

.hub-settings-panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.hub-settings-password-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hub-site-readonly-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(12rem, 1fr));
  gap: 12px 16px;
}

.hub-site-readonly-row div {
  grid-template-columns: 1fr;
  gap: 4px;
  min-width: 0;
}

/* Buttons */

.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--hub-radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
}

.hub-btn-primary {
  background: var(--hub-accent);
  color: var(--hub-accent-text);
  border-color: #ca8a04;
}

.hub-btn-primary:hover {
  background: var(--hub-accent-hover);
  color: var(--hub-accent-text);
}

.hub-btn-secondary {
  background: var(--hub-surface-2);
  color: var(--hub-text);
  border-color: var(--hub-border);
}

.hub-btn-secondary:hover {
  background: #2d3a4d;
}

.hub-btn-ghost {
  background: transparent;
  color: var(--hub-text-muted);
  border-color: var(--hub-border);
}

.hub-btn-ghost:hover {
  color: var(--hub-text);
  background: rgba(255, 255, 255, 0.04);
}

.hub-btn-danger {
  background: rgba(185, 28, 28, 0.25);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
}

.hub-btn-danger:hover {
  background: rgba(185, 28, 28, 0.4);
  color: #fff;
}

.hub-btn-block {
  width: 100%;
}

.hub-confirm-dialog {
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  padding: 22px 24px;
  max-width: 420px;
  width: calc(100% - 32px);
  background: var(--hub-surface);
  color: var(--hub-text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.hub-confirm-dialog::backdrop {
  background: rgba(8, 12, 20, 0.72);
}

.hub-confirm-message {
  margin: 0 0 18px;
  font-size: 1.05rem;
  line-height: 1.45;
}

.hub-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Alerts */

.hub-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--hub-radius-sm);
  border: 1px solid var(--hub-border);
  font-size: 0.92rem;
}

.hub-alert-error {
  background: var(--hub-error-bg);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.hub-alert-ok {
  background: var(--hub-ok-bg);
  border-color: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.hub-alert-token {
  background: var(--hub-token-bg);
  border-color: rgba(250, 204, 21, 0.35);
}

.hub-alert-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.hub-token {
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--hub-radius-sm);
  background: var(--hub-bg-soft);
  border: 1px solid var(--hub-border);
  word-break: break-all;
  font-size: 0.82rem;
  color: var(--hub-accent);
}

/* Site cards */

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

.hub-site-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.hub-site-card.is-online {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(34, 197, 94, 0.12);
}

.hub-site-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
}

.hub-site-card-titleblock {
  min-width: 0;
}

.hub-site-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}

.hub-site-slug {
  margin: 5px 0 0;
  color: var(--hub-text-muted);
  font-size: 0.84rem;
}

.hub-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hub-badge-ok {
  background: var(--hub-ok-bg);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.hub-badge-off {
  background: var(--hub-off-bg);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.hub-site-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.hub-site-contact {
  margin: 14px 18px 0;
  padding: 10px 12px;
  border-radius: var(--hub-radius-sm);
  background: var(--hub-bg-soft);
  border: 1px solid var(--hub-border);
  color: var(--hub-text-muted);
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.hub-site-contact strong {
  color: var(--hub-text);
  font-weight: 600;
}

.hub-site-meta {
  display: none;
}

.hub-site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding: 16px 18px 18px;
}

.hub-site-actions form {
  margin: 0;
}

.hub-site-edit {
  margin-left: auto;
}

.hub-muted-note {
  color: var(--hub-text-muted);
  font-size: 0.88rem;
  margin: 0;
  flex: 1 1 auto;
}

.hub-empty {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--hub-border);
  border-radius: var(--hub-radius);
  background: rgba(255, 255, 255, 0.02);
}

.hub-empty-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.hub-form-inline {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hub-border);
}

.hub-site-readonly {
  display: grid;
  gap: 10px;
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-sm);
  background: var(--hub-bg-soft);
}

.hub-site-readonly div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 8px;
  align-items: baseline;
}

.hub-site-readonly dt {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hub-text-muted);
}

.hub-site-readonly dd {
  margin: 0;
  font-size: 0.88rem;
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .hub-topbar-inner {
    padding-inline: 14px;
  }

  .hub-topbar-meta {
    order: 3;
    width: 100%;
  }

  .hub-user-menu {
    margin-left: auto;
  }

  .hub-page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-page-head .hub-btn {
    width: 100%;
  }

  .hub-site-actions .hub-btn {
    flex: 1 1 auto;
  }

  .hub-site-edit {
    margin-left: 0;
    flex: 1 1 100%;
  }

  .hub-site-readonly-row {
    grid-template-columns: 1fr;
  }

  .hub-site-readonly dd {
    white-space: normal;
  }

  .hub-form-actions-main {
    flex-direction: column-reverse;
  }

  .hub-form-actions-main .hub-btn,
  .hub-edit-section .hub-btn-wide {
    width: 100%;
    min-width: 0;
  }

  .hub-edit-section {
    flex-direction: column;
  }

  .hub-edit-section-action {
    margin-left: 0;
    width: 100%;
  }

  .hub-edit-section-action .hub-btn {
    width: 100%;
  }

  .hub-edit-footer {
    flex-direction: column-reverse;
  }

  .hub-edit-footer .hub-btn {
    width: 100%;
    min-width: 0;
  }

  .hub-settings-password-grid {
    grid-template-columns: 1fr;
  }

  .hub-settings-panel-actions .hub-btn {
    width: 100%;
  }
}

/* Administracija: popis tvrtki */
.hub-card + .hub-card {
  margin-top: 20px;
}

.hub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.hub-table th,
.hub-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hub-border);
}

.hub-table th {
  color: var(--hub-text-muted);
  font-weight: 600;
}
