:root {
  --ink: #1a2332;
  --muted: #5a6a7e;
  --line: #c5d0dc;
  --panel: #f4f7fa;
  --white: #ffffff;
  --accent: #0b5cab;
  --accent-dark: #084484;
  --nav-blue: #003399;
  --nav-bar: #d6e3f0;
  --nav-title: #003399;
  --success: #0d6b3a;
  --success-bg: #e8f6ee;
  --error: #a11919;
  --error-bg: #fdecec;
  --highlight: #fff3bf;
  --shadow: 0 18px 50px rgba(16, 40, 70, 0.14);
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #c9ddf5 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dce8f4 0%, transparent 50%),
    linear-gradient(180deg, #e8eef5 0%, #f7f9fc 40%, #eef3f8 100%);
}

button, input, output { font: inherit; }
code { font-family: var(--mono); font-size: 0.9em; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px 28px 20px;
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 8px;
}
.login-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.login-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--nav-blue), var(--accent));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.brand-mark.sm { width: 36px; height: 36px; font-size: 0.85rem; }

.login-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 12px 0 18px;
  line-height: 1.45;
}

#login-form label,
.booking-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.92rem;
}
#login-form label span,
.booking-form label span { font-weight: 600; }
.booking-form label em {
  font-weight: 400;
  color: var(--muted);
  font-style: normal;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"] {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  border-radius: 2px;
  outline: none;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 92, 171, 0.15);
}

.btn {
  border: 1px solid transparent;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 2px;
  font-weight: 600;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--panel); }
.btn-nav {
  background: #fff;
  border-color: #8aa3c0;
  color: var(--nav-title);
  padding: 5px 10px;
  font-size: 0.85rem;
}

.error { color: var(--error); font-size: 0.9rem; margin-top: 10px; }
.login-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

.main-screen { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-left .muted {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.chip {
  display: inline-flex;
  align-items: center;
  background: #e8f0fa;
  color: var(--nav-blue);
  border: 1px solid #b7cce6;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  background: #e4ebf3;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  border: none;
  background: transparent;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.tab.active {
  color: var(--nav-blue);
  border-bottom-color: var(--nav-blue);
  background: rgba(255,255,255,0.55);
}

.tab-panel { display: none; padding: 20px; flex: 1; }
.tab-panel.active { display: block; }

.panel {
  max-width: 960px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.panel-head {
  padding: 20px 22px 8px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbff, #fff);
}
.panel-head h2 { margin: 0 0 6px; font-size: 1.25rem; }
.panel-head p { margin: 0 0 14px; color: var(--muted); line-height: 1.45; }

.booking-form { padding: 20px 22px 24px; }
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
}
@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}

.input-with-suffix { display: flex; align-items: stretch; }
.input-with-suffix input { flex: 1; border-right: none; }
.input-with-suffix .suffix {
  display: grid;
  place-items: center;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

label.readonly output {
  display: block;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px dashed var(--line);
  font-family: var(--mono);
  font-weight: 600;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.form-actions .btn-primary { width: auto; min-width: 280px; }

.result-box {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #9fd4b4;
  background: var(--success-bg);
  color: var(--success);
  line-height: 1.5;
}
.result-box.error {
  border-color: #e2a0a0;
  background: var(--error-bg);
  color: var(--error);
}
.result-box code {
  display: inline-block;
  background: rgba(255,255,255,0.7);
  padding: 1px 6px;
  margin: 2px 0;
}

/* NAV Classic Client chrome */
.nav-chrome {
  max-width: 1200px;
  margin: 0 auto;
  border: 2px solid #7a94b0;
  background: #ece9d8;
  box-shadow: var(--shadow);
}
.nav-titlebar {
  background: linear-gradient(90deg, #0a246a, #a6caf0);
  color: #fff;
  padding: 6px 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
}
.nav-titlebar .nav-win { margin-left: auto; opacity: 0.95; }
.nav-menubar {
  display: flex;
  gap: 2px;
  padding: 2px 6px;
  background: #ece9d8;
  border-bottom: 1px solid #b0b0b0;
  font-size: 0.85rem;
  color: #222;
  position: relative;
  z-index: 20;
}
.nav-menu { position: relative; }
.nav-menu-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 3px 10px;
  cursor: default;
  font: inherit;
  color: inherit;
}
.nav-menu.open > .nav-menu-btn,
.nav-menu-btn:hover {
  background: #316ac5;
  color: #fff;
  border-color: #316ac5;
}
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid #7a7a7a;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.25);
  padding: 3px 0;
  z-index: 40;
}
.nav-dropdown[hidden] { display: none !important; }
.nav-dropdown button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 5px 18px 5px 28px;
  font: inherit;
  font-size: 0.84rem;
  color: #222;
  cursor: default;
  white-space: nowrap;
}
.nav-dropdown button:hover,
.nav-dropdown button:focus {
  background: #316ac5;
  color: #fff;
  outline: none;
}
.nav-dropdown button.checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M2 6l3 3 5-6' stroke='%23222' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 8px center;
}
.nav-dropdown button.checked:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M2 6l3 3 5-6' stroke='%23fff' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
}
.nav-dropdown .accel {
  margin-left: 28px;
  color: #666;
  font-size: 0.78rem;
}
.nav-dropdown button:hover .accel { color: #e0e0e0; }
.nav-dropdown hr {
  border: none;
  border-top: 1px solid #c0c0c0;
  margin: 4px 8px;
}

.nav-table tr.selected td {
  background: #316ac5 !important;
  color: #fff;
}
.nav-table tr.selected.highlight td {
  background: #2a5aaa !important;
  color: #fff;
}
.nav-table tbody tr { cursor: pointer; }

.nav-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.nav-dialog[hidden] { display: none !important; }
.nav-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 40, 70, 0.35);
}
.nav-dialog-window {
  position: relative;
  width: min(520px, 100%);
  background: #ece9d8;
  border: 2px solid #0a246a;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.nav-dialog-window.wide { width: min(680px, 100%); }
.nav-dialog-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #0a246a, #a6caf0);
  color: #fff;
  padding: 5px 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.nav-dialog-x {
  border: 1px solid #fff;
  background: #c0c0c0;
  color: #000;
  width: 22px;
  height: 20px;
  line-height: 1;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
}
.nav-dialog-body {
  padding: 16px 18px;
  background: #fff;
  margin: 8px;
  border: 1px solid #b0b0b0;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: min(60vh, 420px);
  overflow: auto;
  white-space: pre-wrap;
  font-family: var(--font);
}
.nav-dialog-body.mono {
  font-family: var(--mono);
  font-size: 0.8rem;
}
.nav-dialog-body dl {
  margin: 0;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px 12px;
}
.nav-dialog-body dt { color: var(--muted); font-weight: 600; }
.nav-dialog-body dd { margin: 0; font-family: var(--mono); font-size: 0.84rem; }
.nav-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 10px 10px;
}

.nav-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a2332;
  color: #fff;
  padding: 10px 16px;
  font-size: 0.88rem;
  z-index: 120;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  max-width: min(90vw, 420px);
  text-align: center;
}
.nav-toast[hidden] { display: none !important; }
.nav-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--nav-bar);
  border-bottom: 1px solid #9eb4cc;
  flex-wrap: wrap;
}
.nav-path { font-size: 0.82rem; color: #243552; flex: 1; }
.nav-card-hint {
  padding: 8px 12px;
  background: #fffef5;
  border-bottom: 1px solid #d8d0a8;
  font-size: 0.82rem;
  color: #4a4630;
}
.table-wrap { overflow: auto; background: #fff; max-height: min(60vh, 520px); }
.nav-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: var(--mono);
}
.nav-table th {
  position: sticky;
  top: 0;
  background: #cfdff0;
  color: var(--nav-title);
  text-align: left;
  padding: 7px 8px;
  border: 1px solid #8aa3c0;
  white-space: nowrap;
  font-weight: 700;
}
.nav-table td {
  padding: 6px 8px;
  border: 1px solid #c5d0dc;
  white-space: nowrap;
  background: #fff;
}
.nav-table tr:nth-child(even) td { background: #f7fafc; }
.nav-table tr.highlight td { background: var(--highlight) !important; }
.nav-table td.num, .nav-table th.num { text-align: right; }
.nav-table .empty {
  text-align: center;
  color: var(--muted);
  padding: 28px;
  font-family: var(--font);
}
.nav-statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 5px 10px;
  background: #ece9d8;
  border-top: 1px solid #b0b0b0;
  font-size: 0.78rem;
  color: #333;
}

.arch-steps {
  margin: 0;
  padding: 18px 40px 8px;
  line-height: 1.7;
}
.code-block {
  margin: 12px 22px 22px;
  padding: 14px;
  background: #102033;
  color: #d7e7ff;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
}

[hidden] { display: none !important; }
