/* Blueline Cloud. Tokens from the design canvas (CloudOverview, CloudProperties, CloudDevices...). */
:root {
  --night: #0A1020;
  --blue: #1B3FA0;
  --blue-dark: #16357F;
  --accent: #6FA3FF;
  --white: #F7F9FC;
  --bg: #F1F4F9;
  --card: #FFFFFF;
  --line: #DCE3EE;
  --field: #C9D3E3;
  --muted: #56627A;
  --ink2: #3A4660;
  --info-bg: #DCE8FF;
  --ok-bg: #E3F1E8; --ok-fg: #1E5B3A; --ok-dot: #2F7A4F;
  --warn-bg: #FBEFD5; --warn-fg: #7A4800; --warn-dot: #B7791F;
  --idle-bg: #EEF1F6; --idle-dot: #7C879C;
  --red: #A3122F; --red-bg: #F7DADF; --red-fg: #6B0B1E; --red-line: #E7A9B4;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--night); font: 400 15px/1.5 'Inter', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--night); color: var(--white); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 4px 8px 20px; }
.side .logo img { height: 36px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: rgba(247,249,252,.78); font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color .15s ease-out, color .15s ease-out; }
.nav:hover { background: rgba(247,249,252,.06); color: var(--white); }
.nav.on { background: rgba(111,163,255,.18); color: var(--white); }
.nav svg { flex: none; }
.me { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(247,249,252,.12); display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.me .who { min-width: 0; flex: 1; }
.me .who div:first-child { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who div:last-child { font-size: 12px; color: rgba(247,249,252,.7); text-transform: capitalize; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(247,249,252,.1); color: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: rgba(247,249,252,.18); }
.main { flex: 1 1 auto; min-width: 0; padding: 24px 32px 48px; }
.mtop { display: none; height: 56px; align-items: center; justify-content: space-between; margin: -16px -16px 16px; padding: 0 16px; background: var(--night); position: sticky; top: 0; z-index: 20; }
.mtop img { height: 26px; width: auto; display: block; }
.scrim { position: fixed; inset: 0; background: rgba(10,16,32,.45); z-index: 40; opacity: 0; transition: opacity .2s var(--ease); }
.scrim.show { opacity: 1; }

/* ---------- Page header ---------- */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.head-l { min-width: 0; }
.head-r { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 16px; }
.head h1 { margin-top: 2px; font-size: 32px; line-height: 40px; font-weight: 800; letter-spacing: -.015em; }
.head .switch-btn + h1, .pm-wrap + h1 { margin-top: 12px; }
.head .sub { margin-top: 2px; font-size: 15px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.switcher { height: 36px; padding: 0 32px 0 12px; border-radius: 10px; border: 1px solid var(--field); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230A1020' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center no-repeat; font: 600 14px 'Inter', Arial, sans-serif; color: var(--night); appearance: none; cursor: pointer; max-width: 100%; }

/* ---------- Buttons ---------- */
.btn { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; font: 700 14px 'Inter', Arial, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; transition: background-color .15s ease-out, border-color .15s ease-out, transform .1s ease-out, box-shadow .15s ease-out; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--field); color: var(--night); }
.btn-ghost:hover { border-color: var(--blue); color: var(--night); }
.btn-soft { background: var(--bg); color: var(--blue); }
.btn-danger { background: #fff; border-color: var(--red-line); color: var(--red-fg); }
.btn-danger:hover { background: var(--red-bg); color: var(--red-fg); }
.btn-lg { min-height: 48px; width: 100%; font-size: 15px; }
.link-btn { border: 0; background: none; padding: 0; font: 700 14px 'Inter', Arial, sans-serif; color: var(--blue); cursor: pointer; min-height: 32px; }
.link-btn:hover { color: var(--blue-dark); text-decoration: underline; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards, KPIs, lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.card-head h2 { font-size: 18px; line-height: 28px; font-weight: 800; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.kpi { padding: 20px; }
.kpi .k { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.kpi .v { margin-top: 8px; font-size: 30px; line-height: 36px; font-weight: 800; }
.kpi .v small { font-size: 14px; font-weight: 600; color: var(--muted); }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.line-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); font-size: 14px; padding: 0 20px; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.empty strong { display: block; color: var(--night); font-size: 15px; margin-bottom: 4px; }

.pill { min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.pill.info { background: var(--info-bg); color: var(--blue-dark); } .pill.info .dot { background: var(--blue); }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); } .pill.ok .dot { background: var(--ok-dot); }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); } .pill.warn .dot { background: var(--warn-dot); }
.pill.idle { background: var(--idle-bg); color: var(--ink2); } .pill.idle .dot { background: var(--idle-dot); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font: 600 14px 'Inter', Arial, sans-serif; color: var(--night); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--night); }
.chip.on { background: var(--night); border-color: var(--night); color: var(--white); }

.tbl { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); padding: 12px 16px; background: var(--white); border-bottom: 1px solid var(--line); text-transform: uppercase; }
th:first-child { border-top-left-radius: 16px; } th:last-child { border-top-right-radius: 16px; }
td { padding: 10px 16px; height: 60px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.right, th.right { text-align: right; }
.note { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.field { margin-top: 8px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field); background: #fff; font: 500 15px 'Inter', Arial, sans-serif; color: var(--night); transition: border-color .15s, box-shadow .15s; }
textarea.field { padding: 10px 12px; min-height: 96px; resize: vertical; line-height: 1.5; }
select.field { appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230A1020' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center no-repeat; }
.field:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,63,160,.15); }
.field[aria-invalid="true"] { border-color: var(--red); }
.help { margin-top: 6px; font-size: 13px; color: var(--muted); }
.err { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--red); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.code-input { font: 600 28px var(--mono); letter-spacing: .3em; text-align: center; min-height: 64px; }
.form-msg { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.form-msg.ok { background: var(--ok-bg); color: var(--ok-fg); }
.form-msg.bad { background: var(--red-bg); color: var(--red-fg); }
.form-msg.info { background: var(--info-bg); color: var(--blue-dark); }
.list-edit { display: flex; flex-direction: column; gap: 10px; }
.list-edit .item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.list-edit .item .field { margin-top: 0; }
.list-edit .item .fields { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Drawer ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: #fff; z-index: 50; box-shadow: -20px 0 50px rgba(10,16,32,.18); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s var(--ease); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; line-height: 28px; font-weight: 800; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-foot { display: flex; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line); }
.drawer-foot .btn { flex: 1; }
.close { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--bg); color: var(--night); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 60; background: var(--night); color: var(--white); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 16px 40px rgba(10,16,32,.3); transition: opacity .2s var(--ease), transform .2s var(--ease); pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); }

/* ---------- Content editor ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 20px; overflow-x: auto; }
.tab { min-height: 44px; padding: 0 14px; border: 0; background: none; font: 600 14px 'Inter', Arial, sans-serif; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--night); }
.tab.on { color: var(--blue); border-bottom-color: var(--blue); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; margin-top: 16px; align-items: start; }
.editor .card { padding: 20px; }
.preview-tv { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--night) center / cover; color: var(--white); }
.preview-tv::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,16,32,.88) 0%, rgba(10,16,32,.5) 50%, rgba(10,16,32,.2) 100%); }
.preview-tv > * { position: relative; }
.preview-tv .inner { position: absolute; inset: 0; padding: 7% 6%; display: flex; flex-direction: column; }
.preview-tv .eyebrow { font-size: clamp(9px, 1.1vw, 12px); font-weight: 800; letter-spacing: .18em; color: var(--accent); }
.preview-tv .greet { margin-top: 6px; font-size: clamp(20px, 3.2vw, 38px); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.preview-tv .msg { margin-top: 8px; font-size: clamp(11px, 1.2vw, 14px); color: rgba(247,249,252,.85); max-width: 70%; }
.preview-tv .dock { margin-top: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.preview-tv .dock span { padding: 8px; border-radius: 8px; background: rgba(10,16,32,.55); border: 1px solid rgba(247,249,252,.2); font-size: clamp(9px, 1vw, 12px); font-weight: 700; }
.preview-tv .dock span:first-child { background: var(--white); color: var(--night); }

/* ---------- Sign in ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-hero { position: relative; background: var(--night) url('/img/villa.webp') center / cover; color: var(--white); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,16,32,.55) 0%, rgba(10,16,32,.92) 100%); }
.auth-hero > * { position: relative; }
.auth-hero img { height: 40px; width: auto; display: block; }
.auth-hero .big { font-size: 40px; line-height: 48px; font-weight: 800; max-width: 520px; letter-spacing: -.01em; }
.auth-hero .big + div { margin-top: 12px; font-size: 16px; line-height: 24px; color: rgba(247,249,252,.82); max-width: 480px; }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.auth-panel { width: 100%; max-width: 420px; }
.auth-panel h1 { font-size: 30px; line-height: 36px; font-weight: 800; }
.auth-panel .lead { margin: 6px 0 0; font-size: 15px; line-height: 22px; color: var(--muted); }
.sent-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--info-bg); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }

/* ---------- Loading ---------- */
.skeleton { background: linear-gradient(90deg, #E8EDF4 25%, #F3F6FA 50%, #E8EDF4 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in { animation: fadein .25s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Requests, messages ---------- */
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: var(--white); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
tr.clickable { cursor: pointer; transition: background-color .12s; }
tr.clickable:hover, tr.clickable:focus-visible { background: #F7F9FC; }
.alert-banner { margin-top: 20px; padding: 16px 20px; border-radius: 16px; background: var(--red-bg); border: 1px solid var(--red-line); color: var(--red-fg); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.alert-banner .ic { width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #8A0F28; color: #fff; }
.inbox { margin-top: 20px; display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); min-height: 560px; overflow: hidden; }
.convs { border-right: 1px solid var(--line); overflow-y: auto; max-height: 70vh; }
.conv { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 64px; }
.conv:hover { background: var(--white); }
.conv.on { background: #F1F6FF; }
.conv .avatar { width: 36px; height: 36px; font-size: 14px; }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.conv-last { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-dot { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.thread-body { flex: 1; overflow-y: auto; max-height: 52vh; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; background: var(--white); }
.msg { max-width: 75%; padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.msg.host { align-self: flex-end; background: var(--info-bg); border-color: transparent; }
.msg .meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.sys { align-self: center; font-size: 12px; color: var(--muted); background: var(--idle-bg); padding: 4px 10px; border-radius: 999px; }
.reply { padding: 14px 20px; border-top: 1px solid var(--line); }
.reply-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .editor { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { min-height: 200px; padding: 24px; }
  .auth-hero .big, .auth-hero .big + div { display: none; }
}
@media (max-width: 760px) {
  .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .side.open { transform: none; }
  .mtop { display: flex; }
  .main { padding: 16px; }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .kpi { padding: 16px; } .kpi .v { font-size: 24px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .convs { border-right: 0; max-height: 240px; }
  .head h1 { font-size: 26px; line-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============ Board components (Cloud design canvas) ============ */
.crumb { font-size: 14px; line-height: 20px; color: var(--muted); }
.crumb-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; min-height: 28px; font: 500 14px 'Inter', Arial, sans-serif; color: var(--muted); cursor: pointer; }
.crumb-btn:hover { color: var(--night); }
.switch-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--field); background: #fff; font: 600 14px 'Inter', Arial, sans-serif; color: var(--night); cursor: pointer; transition: border-color .15s; }
.switch-btn:hover, .switch-btn[aria-expanded="true"] { border-color: var(--blue); }
.pm-wrap { position: relative; display: inline-block; }
.pm-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 45; width: 300px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(10,16,32,.18); padding: 6px; animation: fadein .15s var(--ease); }
.pm-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font: inherit; color: var(--night); cursor: pointer; }
.pm-item > span { display: flex; flex-direction: column; font-size: 14px; }
.pm-item .muted { font-size: 12px; }
.pm-item:hover, .pm-item:focus-visible { background: var(--white); }
.pm-item.on { background: #F1F6FF; color: var(--night); }
.pm-item svg { color: var(--blue); flex: none; }
.pm-foot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.pm-add { width: 100%; min-height: 44px; border: 0; border-radius: 10px; background: var(--white); color: var(--blue); font: 700 14px 'Inter', Arial, sans-serif; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.pm-add:hover { background: var(--info-bg); }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: #E3E9F2; margin-top: 16px; max-width: 100%; overflow-x: auto; }
.seg-b { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: none; font: 600 15px 'Inter', Arial, sans-serif; color: var(--ink2); cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s, box-shadow .15s; }
.seg-b:hover { color: var(--night); }
.seg-b.on { background: #fff; color: var(--night); font-weight: 700; box-shadow: 0 1px 3px rgba(10,16,32,.12); }

.live { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-dot); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 16px; margin-top: 16px; align-items: start; }
.split.wide-r { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
.panel { padding: 20px; position: sticky; top: 20px; }
.panel h2 { font-size: 26px; line-height: 32px; font-weight: 800; letter-spacing: -.01em; }
.panel .meta { margin-top: 4px; font-size: 14px; color: var(--muted); }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ref { font: 600 14px var(--mono); color: var(--blue); }
.rows { overflow: hidden; }
.lrow { width: 100%; display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 0; border-top: 1px solid var(--line); border-left: 3px solid transparent; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 64px; transition: background-color .12s; }
.rows > .lrow:first-child, .rows > :first-child .lrow { border-top: 0; }
.lrow:hover { background: var(--white); }
.lrow.on { background: #F1F6FF; border-left-color: var(--blue); }
.lrow .ref { width: 84px; flex: none; color: var(--night); }
.lrow .lm { flex: 1; min-width: 0; font-size: 14px; }
.lrow .lm .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .lm .s { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .when { width: 110px; flex: none; color: var(--muted); font-size: 14px; }
.qty { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 20px; }
.qty div { background: var(--bg); border-radius: 12px; padding: 12px 8px; text-align: center; }
.qty strong { display: block; font: 700 22px var(--mono); }
.qty span { font-size: 13px; color: var(--ink2); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv:last-of-type { border-bottom: 1px solid var(--line); }
.kv span:first-child { color: var(--muted); }
.kv strong { text-align: right; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn-grow { flex: 1 1 200px; }
.btn-dark { background: var(--night); color: #fff; }
.btn-dark:hover { background: #1A2338; color: #fff; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.kpi .v.mono { font-family: var(--mono); font-weight: 600; }

/* Today */
.req-line { display: grid; grid-template-columns: 92px minmax(0, 1fr) 140px auto; align-items: center; gap: 12px; min-height: 60px; padding: 0 20px; border-top: 1px solid var(--line); font-size: 15px; color: inherit; text-decoration: none; }
.req-line:hover { background: var(--white); color: inherit; }
.req-line .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; margin: 0 20px; border-top: 1px solid var(--line); font-size: 15px; }
.alert-banner .ic.soft { background: var(--red); }
.btn-white { background: #fff; border-color: var(--red-line); color: var(--red-fg); }
.btn-white:hover { background: #fff; border-color: var(--red); color: var(--red-fg); }

/* Messages */
.inbox2 { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.conv-list { overflow: hidden; }
.conv-search { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.conv-search .field { margin: 0; font-family: var(--mono); font-size: 14px; background: var(--white); }
.conv2 { width: 100%; display: flex; gap: 12px; padding: 16px; border: 0; border-top: 1px solid var(--line); border-left: 3px solid transparent; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.conv2:first-of-type { border-top: 0; }
.conv2:hover { background: var(--white); }
.conv2.on { background: #F1F6FF; border-left-color: var(--blue); }
.av-soft { width: 40px; height: 40px; border-radius: 50%; background: var(--info-bg); color: var(--blue-dark); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.conv2 .lm { flex: 1; min-width: 0; font-size: 14px; }
.conv2 .top { display: flex; justify-content: space-between; gap: 8px; }
.conv2 .top span { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.conv2 .last { display: block; margin-top: 2px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { min-height: 24px; padding: 0 10px; border-radius: 999px; background: var(--idle-bg); color: var(--ink2); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; }
.tag.new { background: var(--info-bg); color: var(--blue-dark); }
.thread2 { overflow: hidden; display: flex; flex-direction: column; min-height: 640px; }
.thread2 .th-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.thread2 .th-head h2 { font-size: 18px; line-height: 26px; font-weight: 800; }
.thread2 .th-head .meta { font-size: 14px; color: var(--muted); }
.th-body { flex: 1; overflow-y: auto; max-height: 56vh; min-height: 300px; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.day-sep { align-self: center; font-size: 13px; font-weight: 700; color: var(--ink2); letter-spacing: .04em; }
.bub { max-width: min(460px, 80%); padding: 12px 14px; border-radius: 14px; background: var(--idle-bg); font-size: 15px; line-height: 1.45; }
.bub .bm { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.bub.host { align-self: flex-end; background: var(--blue); color: #fff; }
.bub.host .bm { color: rgba(255,255,255,.78); }
.seen-line { align-self: flex-end; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.seen-line svg { color: var(--ok-dot); }
.composer { padding: 16px 20px; border-top: 1px solid var(--line); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.quick button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font: 600 14px 'Inter', Arial, sans-serif; color: var(--night); cursor: pointer; }
.quick button:hover { border-color: var(--blue); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); margin: 0; }
.check.disabled { color: var(--muted); cursor: not-allowed; }

/* Stays / forms in a panel */
.panel .form { gap: 14px; margin-top: 16px; }
.panel .help { margin-top: 6px; }
.info-box { padding: 12px 14px; border-radius: 12px; background: var(--bg); color: var(--ink2); font-size: 14px; line-height: 1.45; }
td .sub2 { font-size: 13px; color: var(--muted); }
tr.hl td { background: #F1F6FF; }

/* Services */
.svc { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); border-left: 3px solid transparent; cursor: pointer; transition: background-color .12s; }
.svc:hover { background: var(--white); }
.svc.on { background: #F1F6FF; border-left-color: var(--blue); }
.svc .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; }
.svc .lm { flex: 1; min-width: 0; font-size: 14px; background: none; border: 0; text-align: left; padding: 0; font-family: inherit; color: inherit; cursor: pointer; }
.svc .lm strong { font-size: 15px; }
.svc .lm div { color: var(--muted); }
.toggle { position: relative; width: 44px; height: 26px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #D5DCE8; transition: background-color .15s; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(10,16,32,.25); transition: transform .15s var(--ease); }
.toggle input:checked + span { background: var(--blue); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.toggle input:disabled { cursor: not-allowed; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-size: 15px; }
.opt { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--ink2); }
.opt button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.opt button:hover { background: #E3E9F2; color: var(--night); }
.wchip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font: 700 14px 'Inter', Arial, sans-serif; color: var(--night); cursor: pointer; }
.wchip.on { background: var(--night); border-color: var(--night); color: #fff; }
.add-opt { display: grid; grid-template-columns: minmax(0, 1fr) 84px auto; gap: 8px; margin-top: 10px; }
.add-opt .field { margin: 0; min-height: 40px; }
details.more { border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary { min-height: 40px; display: flex; align-items: center; font-size: 14px; font-weight: 700; color: var(--blue); cursor: pointer; }

/* Content */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.photo { aspect-ratio: 16 / 10; border-radius: 10px; border: 2px solid transparent; background: center / cover; cursor: pointer; padding: 0; outline-offset: 2px; }
.photo.on { border-color: var(--blue); box-shadow: 0 0 0 2px #fff inset; }
.tvp { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--night) center / cover; color: var(--white); border: 6px solid #111827; box-shadow: 0 20px 50px rgba(10,16,32,.25); }
.tvp::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,16,32,.85) 0%, rgba(10,16,32,.5) 50%, rgba(10,16,32,.15) 100%); }
.tvp > * { position: relative; }
.tvp .bar { position: absolute; left: 6%; right: 4%; top: 7%; display: flex; justify-content: space-between; align-items: center; font: 600 clamp(8px, .8vw, 11px) var(--mono); }
.tvp .bar img { height: clamp(12px, 1.4vw, 18px); width: auto; }
.tvp .inner { position: absolute; left: 6%; right: 6%; top: 30%; bottom: 7%; display: flex; flex-direction: column; }
.tvp .eyebrow { font-size: clamp(8px, .85vw, 11px); font-weight: 800; letter-spacing: .16em; color: var(--accent); }
.tvp .greet { margin-top: 4px; font-size: clamp(18px, 2.2vw, 30px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.tvp .msg2 { margin-top: 6px; font-size: clamp(9px, .9vw, 12px); color: rgba(247,249,252,.88); max-width: 62%; }
.tvp .dock { margin-top: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tvp .dock span { padding: 7px 4px; border-radius: 8px; background: rgba(10,16,32,.6); text-align: center; font-size: clamp(8px, .8vw, 11px); font-weight: 700; }
.tvp .dock span:first-child { background: var(--white); color: var(--night); box-shadow: 0 0 0 2px var(--accent); }
.tvp .lines { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.tvp .lines div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(10,16,32,.6); font-size: clamp(9px, .9vw, 12px); }
.label-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 10px; }
.label-row span:last-child { font-size: 13px; color: var(--muted); }

/* Emergency */
.banner { margin-top: 16px; padding: 14px 18px; border-radius: 14px; display: flex; align-items: center; gap: 12px; font-size: 15px; }
.banner.red { background: var(--red-bg); border: 1px solid var(--red-line); color: var(--red-fg); }
.banner.ok { background: var(--ok-bg); color: var(--ok-fg); font-weight: 600; }
.banner svg { flex: none; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.etype { padding: 20px; }
.etype .t { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.etype .t span { width: 36px; height: 36px; border-radius: 50%; background: var(--red-bg); color: var(--red); display: flex; align-items: center; justify-content: center; }
.etype .form { gap: 14px; }
.h2-out { margin-top: 28px; font-size: 20px; line-height: 28px; font-weight: 800; }

/* Integrations */
.pms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.pms .card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pms .card.conn { border-color: #9CCBAE; }
.pms .who { display: flex; align-items: center; gap: 12px; }
.letter { width: 40px; height: 40px; border-radius: 10px; background: var(--bg); color: var(--night); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.letter.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.pms .who strong { display: block; font-size: 16px; }
.pms .who span { font-size: 13px; color: var(--muted); }
.pms .note2 { font-size: 13px; color: var(--muted); flex: 1; }
.urlbox { margin: 0; font: 500 13px var(--mono); background: var(--white); color: var(--ink2); }
.urlbox.bad { border-color: var(--warn-dot); }
.h-line { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.h-line h2 { font-size: 20px; line-height: 28px; font-weight: 800; }
.direct { margin-top: 12px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.direct .letters { display: flex; gap: 8px; }

/* Team */
.role { min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; }
.role.owner { background: var(--night); color: #fff; }
.role.manager { background: var(--info-bg); color: var(--blue-dark); }
.role.staff { background: var(--idle-bg); color: var(--ink2); }
.role.pending { background: var(--warn-bg); color: var(--warn-fg); }
.person { display: flex; align-items: center; gap: 12px; }
.person .sub2 { font-size: 13px; color: var(--muted); }
.roles3 .card { padding: 18px 20px; }
.roles3 h3 { font-size: 17px; font-weight: 800; }
.roles3 p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Modal */
.modal-scrim { z-index: 70; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 71; width: min(480px, calc(100vw - 32px)); background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 30px 70px rgba(10,16,32,.3); animation: fadein .18s var(--ease); }
.modal h2 { font-size: 22px; line-height: 28px; font-weight: 800; }
.modal p { margin: 8px 0 0; color: var(--ink2); font-size: 15px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

@media (max-width: 1200px) {
  .pms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .split, .split.wide-r, .inbox2 { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .head h1 { font-size: 28px; line-height: 34px; }
  .head-r { justify-content: flex-start; }
  .pms { grid-template-columns: minmax(0, 1fr); }
  .req-line { grid-template-columns: 76px minmax(0, 1fr) auto; padding: 10px 16px; }
  .req-line .when { display: none; }
  .lrow { flex-wrap: wrap; gap: 6px 12px; }
  .lrow .ref { width: auto; }
  .lrow .lm { flex-basis: 100%; order: 3; }
  .lrow .when { display: none; }
  .thread2 { min-height: 0; }
  .th-body { max-height: 50vh; }
  .today-line { margin: 0 16px; }
  .seg { display: flex; }
  .seg-b { flex: 1 0 auto; }
}

.stays-split { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }
table.nowrap td { white-space: nowrap; }
table.nowrap td:first-child { white-space: normal; }
@media (max-width: 1100px) { .stays-split { grid-template-columns: minmax(0, 1fr); } }

.seg { scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.tbl { position: relative; }
