:root {
  --have-bg: #f7f7f5; --have-fg: #1b1f1d; --have-muted: #66706b; --have-line: #dcdfdb;
  --have-accent: #1f5f5b; --have-accent-fg: #ffffff; --have-card: #ffffff; --have-danger: #a33a2a;
  --have-font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --have-bg: #141716; --have-fg: #e8ebe9; --have-muted: #98a29d; --have-line: #2a302d;
  --have-accent: #6fc2bb; --have-accent-fg: #0f2422; --have-card: #1c201e; --have-danger: #f09a8a; color-scheme: dark; } }
:root[data-theme="dark"] {
  --have-bg: #141716; --have-fg: #e8ebe9; --have-muted: #98a29d; --have-line: #2a302d;
  --have-accent: #6fc2bb; --have-accent-fg: #0f2422; --have-card: #1c201e; --have-danger: #f09a8a; color-scheme: dark; }
html, body { margin: 0; background: var(--have-bg); color: var(--have-fg); font-family: var(--have-font); }
.have-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--have-card); border-bottom: 1px solid var(--have-line); }
.have-header a { color: inherit; text-decoration: none; }
.have-mark { display: inline-flex; align-items: center; }
.have-logo { height: 26px; width: auto; display: block; }
.have-header { min-height: 56px; box-sizing: border-box; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .have-logo { content: url("/shell/assets/hotelave-logo-dark.png"); } }
:root[data-theme="dark"] .have-logo { content: url("/shell/assets/hotelave-logo-dark.png"); }
.have-app-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.have-user { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--have-muted); }
/* Controls share one height everywhere: --have-control. Buttons, inputs, selects and segmented toggles all use it. */
:root { --have-control: 36px; }
.have-btn { font: inherit; font-size: 0.85rem; min-height: var(--have-control); padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; border-radius: 6px; border: 1px solid var(--have-line); background: transparent; color: var(--have-fg); cursor: pointer; text-decoration: none; }
.have-btn.primary { background: var(--have-accent); color: var(--have-accent-fg); border-color: var(--have-accent); }
.have-btn:focus-visible { outline: 2px solid var(--have-accent); outline-offset: 2px; }
.have-gate { max-width: 520px; margin: 12vh auto; padding: 0 16px; text-align: center; }
.have-gate h1 { font-size: 1.3rem; }
.have-gate p { color: var(--have-muted); }
/* One page width for every app: content sits beside the rail, centred, never wider than this. */
:root { --have-page-max: 1280px; --have-rail-w: 228px; }
.have-main { max-width: var(--have-page-max); margin: 0 auto; padding: 24px 20px; box-sizing: border-box; }

/* Rail: Home, Records, Apps, Admin. Fixed on a laptop; a drawer behind the ☰ button on a phone. */
html.have-railed body { padding-left: var(--have-rail-w); }
.have-rail { position: fixed; top: 0; left: 0; bottom: 0; width: var(--have-rail-w); z-index: 70; box-sizing: border-box; background: var(--have-card); border-right: 1px solid var(--have-line); display: flex; flex-direction: column; overflow-y: auto; padding: 0 8px 16px; }
.have-rail-brand { display: flex; align-items: center; height: 56px; padding: 0 8px; flex: none; }
.have-rail-links { display: flex; flex-direction: column; gap: 1px; }
.have-rail-group { font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--have-muted); font-weight: 600; padding: 14px 10px 4px; }
.have-rail-link { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 0.88rem; min-height: 32px; box-sizing: border-box; }
.have-rail-link:hover { background: color-mix(in srgb, var(--have-accent) 8%, transparent); }
.have-rail-link[aria-current="page"] { background: var(--have-accent); color: var(--have-accent-fg); font-weight: 600; }
.have-rail-link:focus-visible { outline: 2px solid var(--have-accent); outline-offset: -2px; }
.have-rail-link .glyph { width: 20px; text-align: center; flex: none; }
.have-rail-link .glyph svg { display: block; margin: 0 auto; }
.have-rail-link .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.have-rail-link.sub { padding-left: 38px; font-size: 0.82rem; min-height: 28px; padding-top: 5px; padding-bottom: 5px; }
.have-rail-link.sub .glyph { display: none; }
.have-rail-link .badge { margin-left: auto; font-size: 0.7rem; background: var(--have-danger); color: #fff; border-radius: 999px; padding: 1px 7px; }
.have-rail-link[aria-current="page"] .badge { background: var(--have-accent-fg); color: var(--have-accent); }
.have-rail-scrim { display: none; }
.have-rail-foot { display: none; }
.have-menu-btn { display: none; font-size: 1.1rem; min-width: var(--have-control); padding: 0; }
html.have-railed .have-header .have-mark { display: none; }
@media (max-width: 900px) {
  html.have-railed body { padding-left: 0; }
  html.have-railed .have-header .have-mark { display: inline-flex; }
  .have-menu-btn { display: inline-flex; }
  .have-rail { transform: translateX(-100%); transition: transform .18s ease; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
  html.have-rail-open .have-rail { transform: none; }
  html.have-rail-open .have-rail-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 65; }
  html.have-railed .have-user { display: none; }
  .have-rail-foot { display: grid; gap: 6px; margin-top: auto; padding: 16px 4px 4px; border-top: 1px solid var(--have-line); }
  .have-rail-who { font-size: 0.8rem; color: var(--have-muted); padding: 0 6px; }
  .have-header { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .have-rail { transition: none; } }
@media print { .have-rail, .have-rail-scrim { display: none !important; } html.have-railed body { padding-left: 0; } }
.have-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.have-card { background: var(--have-card); border: 1px solid var(--have-line); border-radius: 8px; padding: 16px; display: grid; gap: 6px; color: inherit; text-decoration: none; }
.have-card:hover { border-color: var(--have-accent); }
.have-card .title { font-weight: 600; }
.have-card .desc { color: var(--have-muted); font-size: 0.9rem; }
.have-card .meta { color: var(--have-muted); font-size: 0.75rem; }
.have-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.have-table th, .have-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--have-line); }
.have-input, .have-select, select.have-input { font: inherit; font-size: 0.9rem; min-height: var(--have-control); padding: 0 10px; box-sizing: border-box; border: 1px solid var(--have-line); border-radius: 6px; background: var(--have-card); color: var(--have-fg); }
textarea.have-input { min-height: 70px; padding: 8px 10px; }
.have-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.have-muted { color: var(--have-muted); }
.have-error { color: var(--have-danger); }

/* Launcher: search + list/icons */
.have-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.have-toolbar .have-input { flex: 1; min-width: 200px; }
.have-seg { display: inline-flex; border: 1px solid var(--have-line); border-radius: 6px; overflow: hidden; }
.have-seg button { font: inherit; font-size: 0.85rem; min-height: calc(var(--have-control) - 2px); padding: 0 12px; border: 0; background: transparent; color: var(--have-fg); cursor: pointer; }
.have-seg button[aria-pressed="true"] { background: var(--have-accent); color: var(--have-accent-fg); }
.have-grid.icons .have-card { text-align: center; align-content: start; }
.have-grid.icons .have-card .glyph { font-size: 2rem; line-height: 1; margin-bottom: 4px; }
.have-list { display: grid; gap: 0; border: 1px solid var(--have-line); border-radius: 8px; overflow: hidden; }
.have-list .have-card { border: 0; border-bottom: 1px solid var(--have-line); border-radius: 0; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; }
.have-list .have-card:last-child { border-bottom: 0; }
.have-list .have-card .glyph { font-size: 1.3rem; }
.have-list .have-card .desc { grid-column: 2; }

/* Connections */
.have-banner { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--have-card); border-bottom: 1px solid var(--have-line); font-size: 0.9rem; }
.have-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--have-fg); color: var(--have-bg); padding: 10px 16px; border-radius: 8px; font-size: 0.9rem; z-index: 100; }
.have-conn { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
.have-conn .status { font-size: 0.8rem; color: var(--have-muted); }
.have-conn .status.on { color: var(--have-accent); font-weight: 600; }
