/* NTsuites Maps dashboard */
:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --text: #142133;
  --muted: #637083;
  --line: #e5e9f0;
  --navy: #0f1d2e;
  --navy-2: #172a40;
  --brand: #0a66d6;
  --brand-dark: #0852ad;
  --brand-soft: #e8f1fc;
  --available: #1e9b4b;
  --available-bg: #e8f7ee;
  --soon: #c97a00;
  --soon-bg: #fff4e0;
  --occupied: #d0352d;
  --occupied-bg: #fdecea;
  --unavailable: #8a96a8;
  --hl: #0a66d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 18px rgba(16,24,40,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14.5px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 16.5px; margin: 0 0 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Shell: sidebar + main ---- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--navy) 250px, transparent 250px); }
.sidebar { background: var(--navy); color: #c9d5e5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; }
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 14px; }
.sidebar .logo img { height: 40px; width: auto; }
.sidebar .logo span { font-size: 12px; color: #8ea2bc; line-height: 1.2; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #6f86a3; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: #c9d5e5; font-size: 14px; }
.nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; background: #3fd17a; margin-left: auto; flex: none; }
.nav .dot.draft { background: #f0a020; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.sidebar-foot .who { flex: 1; min-width: 0; font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who small { display: block; color: #8ea2bc; font-size: 11.5px; }
.sidebar-foot button { background: transparent; border: 1px solid rgba(255,255,255,.18); color: #c9d5e5; border-radius: 8px; padding: 6px; cursor: pointer; display: grid; place-items: center; }
.sidebar-foot button:hover { background: var(--navy-2); color: #fff; }

.main { min-width: 0; }
.mobile-bar { display: none; }
.container { max-width: 1280px; margin: 0 auto; padding: 28px 28px 56px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(5,15,30,.45); }
  .mobile-bar { display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 40; }
  .mobile-bar img { height: 30px; }
  .mobile-bar button { background: transparent; border: 0; color: #fff; padding: 4px; cursor: pointer; display: grid; }
  .container { padding: 20px 16px 40px; }
}

/* ---- Page header ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---- Panels, grids ---- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }
/* minmax(0, …) so a wide table inside can't push the column wider than the screen. */
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* Stat tiles */
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.tile .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.tile .ico.green { background: var(--available-bg); color: var(--available); }
.tile .ico.amber { background: var(--soon-bg); color: var(--soon); }
.tile .ico.red { background: var(--occupied-bg); color: var(--occupied); }
.tile b { display: block; font-size: 22px; line-height: 1.1; }
.tile span { font-size: 12.5px; color: var(--muted); }

/* Location cards with the building photo */
.loc-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.loc-cover { height: 120px; background: var(--navy) center / cover no-repeat; position: relative; display: flex; align-items: flex-end; padding: 14px 18px; color: #fff; }
.loc-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,16,28,.1), rgba(8,16,28,.75)); }
.loc-cover > * { position: relative; z-index: 1; }
.loc-cover h2 { margin: 0; color: #fff; font-size: 17px; }
.loc-cover h2 a { color: #fff; }
.loc-cover .badge { position: absolute; top: 12px; right: 12px; }
.loc-body { padding: 16px 18px 18px; }

/* Flash */
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; display: flex; gap: 10px; align-items: flex-start; }
.flash.ok { background: #e9f8ef; border: 1px solid #bfe7cd; color: #14532d; }
.flash.err { background: #fdecea; border: 1px solid #f5c2bd; color: #7f1d1d; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 8px 15px; border-radius: 10px; font: 500 14px/1.3 inherit; font-family: inherit; cursor: pointer; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn.secondary:hover { background: #f5f7fa; }
.btn.danger { background: #fff; color: #b42318; border-color: #f3c0bb; }
.btn.danger:hover { background: #fdecea; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #9cc3f5; outline-offset: 1px; }

/* Forms */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d5dbe4; border-radius: 10px; font: inherit; background: #fff; color: var(--text);
}
input[type=file] { padding: 7px; background: #fafbfc; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(10,102,214,.15); }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.inline { display: flex; gap: 8px; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; font-weight: 400; margin: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #f8fafc; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: #fafcff; }
tr.is-hidden td { opacity: .5; }
tr.is-located td { background: #eef5ff !important; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.btn.sm { white-space: nowrap; }

/* Phones: each table row becomes a card of "LABEL  value" lines. The layout script
   copies the header text into data-label and wraps each cell's content in .cell. */
@media (max-width: 700px) {
  .table-wrap { border: 0; border-radius: 0; overflow: visible; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr.head { display: none; }
  table.stack tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 0; margin-bottom: 10px; background: #fff; }
  table.stack tr:last-child { margin-bottom: 0; }
  table.stack td { border: 0; padding: 6px 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; text-align: right !important; }
  table.stack td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  table.stack td[data-label=""]::before { content: none; }
  table.stack td[data-label=""] { justify-content: flex-end; }
  table.stack td:not([data-label]) { display: block; text-align: left !important; }
  table.stack td > .cell { min-width: 0; overflow-wrap: anywhere; }
  table.stack td .inline { flex-wrap: wrap; justify-content: flex-end; }
  table.stack td input[type=text] { min-width: 0 !important; flex: 1 1 140px; }
  table.stack tr:hover td { background: transparent; }
  table.stack tr.is-located { background: #eef5ff; }
}

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.available, .badge.success { background: var(--available-bg); color: var(--available); }
.badge.available_soon, .badge.running { background: var(--soon-bg); color: var(--soon); }
.badge.occupied, .badge.failed { background: var(--occupied-bg); color: var(--occupied); }
.badge.unavailable, .badge.unknown { background: #eef1f5; color: var(--unavailable); }
.loc-cover .badge.success { background: #3fd17a; color: #0b3d1f; }
.loc-cover .badge.running { background: #ffc35a; color: #4a2c00; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; background: #eef1f6; color: var(--muted); font-weight: 500; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

.stat { display: flex; gap: 20px; flex-wrap: wrap; }
.stat div { min-width: 60px; }
.stat b { display: block; font-size: 22px; line-height: 1.2; }

/* Floor plan editor */
.plan { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.plan svg { width: 100%; height: auto; max-height: 75vh; display: block; }
.plan svg text, .plan svg tspan { pointer-events: none; }
.plan.mapping svg [data-shape] { cursor: pointer; }
.plan.mapping svg [data-shape]:hover { stroke: var(--hl) !important; stroke-width: 6px !important; }
.plan svg .is-selected { stroke: var(--hl) !important; stroke-width: 10px !important; }
.plan svg .is-located { stroke: #111 !important; stroke-width: 12px !important; }
.plan.drawing svg { cursor: crosshair; }
.plan svg .nts-draft { fill: rgba(10,102,214,.22); stroke: var(--hl); stroke-width: 4px; stroke-dasharray: 10 6; }
.mode-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.mode-bar .btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Grid view of suites (floors without a plan) */
.suite-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.suite-card { border-radius: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--unavailable); }
.suite-card.available { background: var(--available); border-color: var(--available); color: #fff; }
.suite-card.available .meta { color: rgba(255,255,255,.88); }
.suite-card.available_soon { background: #facc15; border-color: #facc15; color: #3b2a00; }
.suite-card.available_soon .meta { color: #5c4300; }
.suite-card.occupied { border-left-color: var(--occupied); }
.suite-card .num { font-size: 19px; font-weight: 700; }
.suite-card .meta { font-size: 12.5px; color: var(--muted); }
.suite-card .note { margin-top: 6px; font-size: 12px; background: #f3f5f8; border-radius: 6px; padding: 2px 6px; display: inline-block; }

/* Setup checklist */
.checklist { margin: 0 0 12px; padding-left: 0; list-style: none; counter-reset: step; }
.checklist li { counter-increment: step; position: relative; padding: 10px 0 10px 44px; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: counter(step); position: absolute; left: 0; top: 10px; width: 28px; height: 28px; border-radius: 50%; background: #eef1f6; color: var(--muted); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.checklist li.done::before { content: "\2713"; background: var(--available); color: #fff; }
.progress { height: 8px; background: #eef1f6; border-radius: 999px; overflow: hidden; margin: 4px 0 14px; }
.progress span { display: block; height: 100%; background: var(--available); border-radius: 999px; }

/* Points of contact page */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.contact-tile { margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.contact-tile .poc-card { border: 0; padding: 12px 14px; }
.contact-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px 2px; border-top: 1px solid var(--line); }

.pdf-box { border: 1px dashed #c9d2de; border-radius: 10px; padding: 12px; margin-bottom: 12px; background: #fafbfd; }
.pdf-box p { margin: 0 0 8px; }
.pdf-box img { display: block; max-width: 100%; max-height: 220px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.cover-preview { width: 100%; aspect-ratio: 16 / 7; border-radius: 10px; background: #e9edf3 center / cover no-repeat; margin-bottom: 8px; border: 1px solid var(--line); }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--navy) center / cover no-repeat; position: relative; }
.login-page::before { content: ""; position: absolute; inset: 0; background: rgba(8,16,28,.6); }
.login-box { position: relative; width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 30px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-box .brand-pair { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.login-box .brand-plus { font-size: 22px; font-weight: 600; color: var(--muted); }
.login-box .rnd-badge { display: inline-flex; align-items: center; gap: 7px; height: 50px; padding: 0 16px; border-radius: 10px; border: 1px solid #d5dbe4; background: #fff; color: #2a2f8f; font-weight: 700; font-size: 18px; letter-spacing: .01em; }
.login-box .rnd-badge svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.login-box .sync-note { display: flex; align-items: center; gap: 8px; margin: -4px 0 18px; padding: 8px 12px; border-radius: 8px; background: #eef4ff; color: #1e3a6b; font-size: 13px; }
.login-box .sync-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); flex: none; }
.login-box .logo-dark { display: inline-block; background: var(--navy); border-radius: 10px; padding: 8px 12px; }
@media (max-width: 420px) {
  .login-box { padding: 24px 20px; }
  .login-box .brand-pair { flex-wrap: nowrap; gap: 8px; }
  .login-box .logo-dark { padding: 6px 9px; }
  .login-box .logo-dark img { height: 28px; }
  .login-box .rnd-badge { height: 42px; padding: 0 10px; font-size: 15px; gap: 5px; }
  .login-box .rnd-badge svg { width: 15px; height: 15px; }
  .login-box .brand-plus { font-size: 18px; }
}
.login-box .logo-dark img { height: 34px; display: block; }
.login-box .btn { width: 100%; padding: 11px; }
