:root {
    --bg: var(--color-bg, #faf9f8);
    --panel: var(--color-surface, #ffffff);
    --panel-soft: var(--color-surface, #ffffff);
    --text: var(--color-text, #323130);
    --muted: var(--color-text-muted, #a19f9d);
    --accent: var(--color-primary, #19974E);
    --danger: var(--color-danger, #A4262C);
}

* { box-sizing: border-box; }

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--panel);
    border-bottom: 1px solid var(--color-border, #E6E6E6);
}

.brand {
    font-weight: 700;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    height: 34px;
    width: auto;
    display: block;
}

.brand-text {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 1rem;
}

.topnav {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-left: auto;
}

.topnav a, .link-button {
    color: var(--text);
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
}

.topnav-link {
    opacity: .9;
}

.topnav-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.topnav-user {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: -10px;
}

.topnav-user-trigger {
    border: 1px solid var(--color-border, #E6E6E6);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text);
    padding: .35rem .75rem;
    cursor: pointer;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topnav-user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 2px);
    min-width: 160px;
    background: var(--panel);
    border: 1px solid var(--color-border, #E6E6E6);
    border-radius: 10px;
    padding: .35rem;
    z-index: 20;
}

.topnav-user:hover .topnav-user-menu,
.topnav-user:focus-within .topnav-user-menu {
    display: block;
}

.topnav-user-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    color: var(--text);
    border-radius: 8px;
    padding: .5rem .65rem;
    cursor: pointer;
}

.topnav-user-item:hover {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.topnav-user-separator {
    height: 1px;
    margin: .25rem 0;
    background: var(--color-border, #E6E6E6);
}

.content {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.content-login {
    max-width: none;
    margin: 0;
    padding: 0;
}

.card {
    background: var(--panel);
    border: 1px solid var(--color-border, #E6E6E6);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card.narrow {
    max-width: 460px;
    margin-inline: auto;
}

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

.menu-item {
    border: 1px solid var(--color-border, #E6E6E6);
    border-radius: 12px;
    padding: 1rem;
    background: var(--panel);
}

.form-grid {
    display: grid;
    gap: .7rem;
}

input, select {
    border-radius: 10px;
    border: 1px solid var(--color-border, #E6E6E6);
    background: var(--panel);
    color: var(--text);
    padding: .6rem .7rem;
}

.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--color-on-primary, #ffffff);
    padding: .6rem 1rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.2;
    transition: transform .05s ease, filter .15s ease, box-shadow .15s ease;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.18));
}

.primary:hover {
    filter: brightness(1.03);
}

.primary:active {
    transform: translateY(1px);
}

.primary:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring, 0 0 0 3px rgba(25, 151, 78, .35));
}

.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border, #E6E6E6);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: .6rem 1rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.2;
    transition: filter .15s ease, box-shadow .15s ease;
}

.secondary:hover {
    filter: brightness(0.98);
}

.secondary:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring, 0 0 0 3px rgba(25, 151, 78, .35));
}

.alert {
    background: color-mix(in srgb, var(--danger) 20%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent);
    color: var(--text);
    padding: .7rem;
    border-radius: 10px;
    margin-bottom: .8rem;
}

.result {
    margin-top: 1rem;
    border-radius: 10px;
    padding: .8rem;
    border: 1px solid var(--color-border, #E6E6E6);
}

.result.success { border-color: rgba(34, 197, 94, .7); }
.result.error { border-color: rgba(244, 63, 94, .7); }

.stayapi-result,
.stayapi-suggestions {
  margin-top: 1.5rem;
}

.stayapi-photo-links {
  overflow-wrap: anywhere;
}

.json-viewer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.json-viewer-heading h3 {
  margin: 0;
}

.json-viewer-heading div {
  display: flex;
  gap: .5rem;
}

.json-viewer {
  margin-top: .75rem;
  padding: 1rem;
  overflow: auto;
  max-height: 42rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .875rem;
}

.json-viewer summary {
  cursor: pointer;
  font-weight: 600;
}

.json-children {
  margin-left: 1.25rem;
  padding-left: .75rem;
  border-left: 1px solid var(--color-border);
}

.json-row {
  padding: .1rem 0;
}

.json-key { color: #2563eb; }
.json-string { color: #15803d; }
.json-number { color: #b45309; }
.json-boolean { color: #7c3aed; }
.json-null { color: var(--color-text-muted); }

@media (max-width: 640px) {
  .json-viewer-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table th, .permissions-table td {
    border-bottom: 1px solid var(--color-border, #E6E6E6);
    padding: .6rem;
    text-align: left;
    vertical-align: top;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at 50% 8%, #3f8f93 0%, #2b7b7f 35%, #14635f 70%, #0d554f 100%);
}

.login-panel {
    width: 100%;
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 12px;
    background: #014344;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
    padding: 1.5rem 1.2rem;
}

.login-panel-wide {
    max-width: 420px;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: .6rem;
}

.login-logo {
    width: 100%;
    max-width: 150px;
    height: auto;
}

.login-logo-secondary-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-logo-secondary {
    width: 100%;
    max-width: 240px;
    height: auto;
}

.login-title {
    margin: 0;
    text-align: center;
    font-size: 1.25rem;
}

.login-subtitle {
    margin: .35rem 0 1rem;
    text-align: center;
    color: var(--muted);
}

.login-submit {
    width: 100%;
    margin-top: .35rem;
    min-height: 38px;
}

.login-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: .8rem 0 .8rem;
    color: rgba(255,255,255,.8);
    font-size: .9rem;
    letter-spacing: normal;
}

.login-divider::before,
.login-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255,255,255,.35);
}

.login-divider::before {
    margin-right: .6rem;
}

.login-divider::after {
    margin-left: .6rem;
}

.login-panel label {
    display: none;
}

.login-panel input {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    background: #f4f4f4;
    color: #2c2c2c;
    padding: .52rem .62rem;
}

.login-panel input::placeholder {
    color: #7f7f7f;
}

.login-panel .primary {
    border-radius: 4px;
    background: #2fa64a;
    box-shadow: none;
}

.login-panel .primary:hover {
    filter: brightness(1.05);
}

.login-panel .secondary {
    border: 0;
    background: transparent;
    color: #ffffff;
    box-shadow: none;
    padding: .25rem 0;
    min-height: 32px;
}

.login-entra {
    gap: .5rem;
}

.login-entra-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    line-height: 1;
}

.login-entra-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.login-deadline {
    background: rgba(255, 180, 0, .12);
    border: 1px solid rgba(255, 180, 0, .35);
    border-radius: 6px;
    padding: .6rem .75rem;
    color: #ffe082;
    font-size: .88rem;
    line-height: 1.45;
}

.login-link {
    color: #b8e6c9;
    text-decoration: underline;
    font-weight: 600;
}

.login-link:hover {
    color: #ffffff;
}
