/* ivCloud — application styles.
   Tokens come from the inVirtus cloud theme (default/theme.scss, navbar.scss):
   a theme is another CSS file that overrides the custom properties below. */

:root {
  --primary: #005d9c;
  --primary-dark: #004a7c;
  --secondary: #5a6268;
  --success: #1dbb99;
  --danger: #f35958;
  --warning: #f79f1f;
  --info: #1f3953;
  --light: #f8f9fa;
  --dark: #575757;
  --darker-blue: #052337;

  --nav-bg: var(--darker-blue);
  --nav-text: #acafb9;
  --nav-text-selected: #ffffff;
  --nav-bg-selected: #374f66;
  --nav-bg-hover: rgba(55, 79, 102, 0.75);
  --nav-separator: #5b6576;
  --nav-width: 240px;

  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --border: #dee2e6;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(5, 35, 55, 0.08), 0 4px 12px rgba(5, 35, 55, 0.06);
  --font: Ubuntu, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 500; }
h1 { font-size: 1.5em; }
h2 { font-size: 1.2em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

/* ---------------------------------------------------------------- layout */
.layout { display: flex; min-height: 100vh; }
.navbar-container { width: var(--nav-width); flex: 0 0 var(--nav-width); }
nav.left-side-navbar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--nav-width);
  background: var(--nav-bg); color: var(--nav-text);
  display: flex; flex-direction: column; padding: .75em; z-index: 100;
}
.content-container { flex: 1 1 auto; min-width: 0; padding: 1.25em 1.5em; }
.navbar-content { display: flex; flex-direction: column; height: 100%; }
.navbar-content .logo { display: flex; justify-content: center; padding: .25em .5em .5em; }
.navbar-content .logo a { display: block; background: #fff; border-radius: 6px; padding: 6px 10px; }
.navbar-content .logo img { height: 36px; display: block; }
.separator { height: 1px; background: var(--nav-separator); margin: .75em 0; border: 0; }
.nav-items { display: flex; flex-direction: column; gap: .5em; flex: 1 1 auto; overflow: auto; }
.nav-items::-webkit-scrollbar { width: 5px; }
.nav-items::-webkit-scrollbar-thumb { background: var(--nav-bg-selected); border-radius: 100px; }
.nav-item {
  display: flex; align-items: center; gap: .35em; padding: 4px 8px; border-radius: .5em;
  color: var(--nav-text); background: transparent; border: 0; font: inherit; cursor: pointer;
  text-decoration: none; text-align: left; width: 100%;
}
.nav-item:hover { color: var(--nav-text-selected); background: var(--nav-bg-hover); text-decoration: none; }
.nav-item.active { color: var(--nav-text-selected); background: var(--nav-bg-selected); }
.nav-item svg { width: 1.1em; height: 1.1em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-section > .nav-item { font-size: .95em; text-transform: uppercase; gap: .5em; }
.nav-section > .nav-item .chevron { width: .7em; height: .7em; transition: transform .25s; }
.nav-section.open > .nav-item .chevron { transform: rotate(90deg); }
.nav-section .collapsible-content { display: none; flex-direction: column; gap: .25em; margin-top: .25em; padding-left: .75em; }
.nav-section.open .collapsible-content { display: flex; }
.profile-container { margin-top: 1em; }
.profile-container .displayed-text { color: var(--success); margin: .2em .5em; font-size: .9em; }
.profile { position: relative; }
.profile > button {
  display: flex; align-items: center; gap: .5em; width: 100%; padding: 4px 10px; height: 40px;
  background: transparent; border: 0; color: var(--nav-text-selected); font: inherit; cursor: pointer; border-radius: .5em;
}
.profile > button:hover { background: var(--nav-bg-hover); }
.picture-profile { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--nav-text); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.picture-profile svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.profile .name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.profile .account-name { font-size: .8em; color: var(--nav-text); display: block; }
.dropup { position: absolute; left: 0; right: 0; bottom: 44px; background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow); padding: .4em 0; display: none; z-index: 200; }
.profile.open .dropup { display: block; }
.dropup .item { display: flex; align-items: center; gap: .5em; padding: .45em .9em; cursor: pointer; color: var(--text); width: 100%; background: none; border: 0; font: inherit; text-align: left; }
.dropup .item:hover { background: var(--light); text-decoration: none; }
.dropup .item.active { font-weight: 500; color: var(--primary); }
.dropup .item svg { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; }
.dropup .section { padding: .3em .9em .1em; font-size: .75em; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.dropup hr { border: 0; border-top: 1px solid var(--border); margin: .3em 0; }

/* ---------------------------------------------------------------- page */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1em; margin-bottom: 1em; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.page-actions { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1em 1.25em; }
.card + .card { margin-top: 1em; }
.grid > .card { margin-top: 0; }
.toolbar select, .page-actions select { width: auto; max-width: 260px; }
.grid { display: grid; gap: 1em; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.stat { display: flex; flex-direction: column; gap: .2em; }
.stat .value { font-size: 1.9em; font-weight: 500; color: var(--primary); line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .9em; }
.stat.warn .value { color: var(--warning); }
.stat.danger .value { color: var(--danger); }
.stat.ok .value { color: var(--success); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4em; padding: .45em .9em; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--light); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { padding: .25em .6em; font-size: .9em; }
.btn svg { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-group { display: inline-flex; gap: .25em; }

/* ---------------------------------------------------------------- forms */
.form-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: .5em 1em; align-items: center; margin-bottom: .6em; }
.form-row label { color: var(--dark); }
.form-row .help { grid-column: 2; color: var(--muted); font-size: .85em; margin-top: -.3em; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input[type=datetime-local], select, textarea {
  font: inherit; padding: .45em .6em; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); width: 100%; max-width: 480px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0, 93, 156, .25); border-color: var(--primary); }
input[type=checkbox] { accent-color: var(--primary); width: 1.1em; height: 1.1em; }
textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; gap: .5em; margin-top: 1em; padding-top: 1em; border-top: 1px solid var(--border); }
.field-error { color: var(--danger); font-size: .85em; }
.inline { display: inline-flex; align-items: center; gap: .4em; }
.chips { display: flex; flex-wrap: wrap; gap: .35em; }
.chip { display: inline-flex; align-items: center; gap: .3em; padding: .15em .55em; border-radius: 999px; background: var(--light); border: 1px solid var(--border); font-size: .9em; }
.chip .dot { width: .6em; height: .6em; border-radius: 50%; display: inline-block; }
.chip.selectable { cursor: pointer; }
.chip.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------------------------------------------------------------- tables */
.toolbar { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; margin-bottom: .75em; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar .spacer { flex: 1 1 auto; }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.list th, table.list td { padding: .55em .75em; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list th { background: var(--light); font-weight: 500; color: var(--dark); white-space: nowrap; user-select: none; }
table.list th.sortable { cursor: pointer; }
table.list th.sorted::after { content: " ▲"; font-size: .7em; color: var(--primary); }
table.list th.sorted.desc::after { content: " ▼"; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: #f1f6fa; }
table.list tbody tr.selected { background: #e3eff8; }
table.list td.actions { white-space: nowrap; text-align: right; }
table.list td .btn { opacity: .85; }
table.list .empty { text-align: center; color: var(--muted); padding: 2em; cursor: default; }
.pager { display: flex; align-items: center; gap: .5em; margin-top: .75em; color: var(--muted); flex-wrap: wrap; }
.pager .spacer { flex: 1 1 auto; }
.badge { display: inline-block; padding: .15em .5em; border-radius: 4px; font-size: .8em; background: var(--light); color: var(--dark); }
.badge.ok { background: #dff6ef; color: #0f7a63; }
.badge.warn { background: #fdebd3; color: #9a5a00; }
.badge.danger { background: #fde0df; color: #a52524; }
.badge.info { background: #dbe9f5; color: var(--primary); }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; vertical-align: middle; margin-right: .3em; }

/* ---------------------------------------------------------------- misc */
.toast-container { position: fixed; top: 1em; right: 1em; z-index: 1000; display: flex; flex-direction: column; gap: .5em; }
.toast { background: var(--info); color: #fff; padding: .6em 1em; border-radius: 6px; box-shadow: var(--shadow); max-width: 360px; animation: toast-in .2s ease-out; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: flex; align-items: center; gap: .6em; color: var(--muted); padding: 2em; }
dialog { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 0; max-width: 92vw; }
dialog::backdrop { background: rgba(5, 35, 55, .45); }
dialog .dialog-body { padding: 1.25em 1.5em; min-width: 360px; }
dialog h2 { margin-bottom: .75em; }
.map { width: 100%; height: 520px; border-radius: var(--radius); overflow: hidden; background: #e9eef2; }
.map.tall { height: calc(100vh - 140px); }
.leaflet-container { font-family: var(--font); }
.asset-marker { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.asset-marker.moving { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(29,187,153,.6); } 100% { box-shadow: 0 0 0 10px rgba(29,187,153,0); } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3em 1em; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.tabs { display: flex; gap: .25em; border-bottom: 1px solid var(--border); margin-bottom: 1em; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: .5em .9em; font: inherit; color: var(--muted); cursor: pointer; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.licence-banner { background: var(--warning); color: #fff; padding: .5em 1em; border-radius: 6px; margin-bottom: 1em; }
.readonly-banner { background: var(--danger); color: #fff; padding: .5em 1em; border-radius: 6px; margin-bottom: 1em; }

/* ---------------------------------------------------------------- portal (login) */
body.portal { background: var(--bg); }
.login-container { min-height: 100vh; display: flex; }
.login-container .left-pane { flex: 1 1 50%; background: linear-gradient(135deg, var(--primary) 0%, #09b5aa 100%); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 3em; }
.login-container .left-pane h1 { font-size: 2.2em; font-weight: 300; }
.login-container .left-pane p { max-width: 420px; opacity: .9; line-height: 1.5; }
.login-container .right-pane { flex: 1 1 50%; display: flex; align-items: center; justify-content: center; padding: 2em; }
.login-box { width: 100%; max-width: 380px; }
.login-box .brand { display: flex; justify-content: center; margin-bottom: 1.5em; }
.login-box .brand img { height: 56px; }
.login-box label { display: block; margin: .8em 0 .3em; color: var(--dark); }
.login-box input { max-width: none; }
.login-box .btn-login { width: 100%; justify-content: center; margin-top: 1.2em; background: var(--success); border-color: var(--success); color: #fff; padding: .7em; font-size: 1.05em; }
.login-box .btn-login:hover { filter: brightness(.95); }
.login-box .error { color: var(--danger); margin-top: .6em; min-height: 1.2em; }
.login-box .links { margin-top: 1em; display: flex; justify-content: space-between; font-size: .9em; }
.login-box .links a { color: var(--success); }
.accounts-list { display: flex; flex-direction: column; gap: .5em; margin-top: 1em; }
.account-card { display: flex; align-items: center; gap: .8em; padding: .8em 1em; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; cursor: pointer; text-align: left; font: inherit; width: 100%; }
.account-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.account-card .avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 500; flex: 0 0 auto; }
.account-card .meta { font-size: .85em; color: var(--muted); }
@media (max-width: 800px) { .login-container .left-pane { display: none; } }

/* ---------------------------------------------------------------- maintenance */
body.maintenance { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.maintenance-box { background: var(--surface); padding: 2em 3em; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; max-width: 520px; }

/* ---------------------------------------------------------------- responsive nav */
.toggle-left-sidebar { display: none; position: fixed; top: .6em; left: .6em; z-index: 110; background: var(--nav-bg); color: #fff; border: 0; border-radius: 6px; padding: .4em .6em; cursor: pointer; }
@media (max-width: 900px) {
  .navbar-container { width: 0; flex-basis: 0; }
  nav.left-side-navbar { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open nav.left-side-navbar { transform: none; }
  .toggle-left-sidebar { display: block; }
  .content-container { padding-top: 3.2em; }
}

/* pickers (link manager), inline lists, logs */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 1100; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.12); max-height: 240px; overflow: auto; }
.picker-list:empty { display: none; }
.picker-item { padding: .4em .6em; cursor: pointer; }
.picker-item:hover { background: var(--light); }
.picker-selected { margin-top: .3em; font-weight: 600; }
.inline-list { display: flex; flex-wrap: wrap; gap: .6em 1em; align-items: center; }
.highlight { background: #fff6d6; border-radius: 4px; padding: .2em .4em; }
ul.log { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow: auto; font-family: var(--mono); font-size: .85em; }
ul.log li { padding: .25em 0; border-bottom: 1px solid var(--border); }
ul.log li.ok { color: var(--ok, #2a7); }
ul.log li.error { color: var(--danger); }
.login-box.wide { max-width: 560px; }
.restricted .card { margin-top: 1em; text-align: left; }
.restricted h3 { margin: 0 0 .5em; font-size: 1em; }
.card.schedule { margin-bottom: .75em; }

/* metrics grid */
.widget-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 56px; gap: 1em; }
.widget-grid > .card { margin-top: 0; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.widget-head { display: flex; align-items: center; gap: .5em; margin-bottom: .5em; }
.widget-head h2 { margin: 0; font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-head .small { font-size: .75em; white-space: nowrap; }
.widget-tools { display: flex; gap: .2em; flex-wrap: wrap; }
.widget-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.widget-empty { grid-column: span 12; }
.stat.big .value { font-size: 2.6em; }
.stat .value.ok { color: #2a9d8f; } .stat .value.warn { color: #f4a261; } .stat .value.danger { color: var(--danger); }
.chart-box { position: relative; height: 180px; }
.chart-box.small { height: 140px; }
.bar-row { margin: .35em 0; }
.bar-label { display: flex; justify-content: space-between; font-size: .9em; }
.bar { height: 7px; background: #eef2f5; border-radius: 4px; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 4px; }
.bar-fill.warn { background: #f4a261; } .bar-fill.danger { background: var(--danger); }
table.list.compact td, table.list.compact th { padding: .25em .5em; }

/* analysis */
form.toolbar input[type=datetime-local] { width: auto; }
.timeline { overflow-x: auto; }
.tl-row { display: flex; align-items: center; gap: .5em; min-height: 26px; }
.tl-row.head { height: 28px; margin-bottom: .4em; }
.tl-label { flex: 0 0 180px; font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; flex: 1 1 auto; height: 18px; background: #f1f3f5; border-radius: 3px; }
.tl-bar { position: absolute; top: 0; height: 100%; border-radius: 3px; opacity: .9; }
.tl-axis { position: relative; height: 100%; }
.tl-tick { position: absolute; top: 0; font-size: .7em; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.chip.danger { background: #fde2e4; color: var(--danger); }

/* wizards */
.steps { display: flex; gap: .5em; margin-bottom: 1em; flex-wrap: wrap; }
.steps .step { padding: .35em .8em; border-radius: 999px; background: #eef2f5; color: var(--muted); font-size: .9em; }
.steps .step.active { background: var(--primary); color: #fff; }
.steps .step.done { background: #d8e9f3; color: var(--primary); }
.radio-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .4em .8em; }
.radio-list .radio { display: flex; align-items: center; gap: .4em; padding: .3em; }

/* signals matrix */
table.signals th.rot div { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 160px; white-space: nowrap; }
table.signals td.rssi { text-align: center; font-family: var(--mono); }
table.signals td.rssi.strong { background: #d6f2e9; } table.signals td.rssi.medium { background: #fdf0d8; } table.signals td.rssi.weak { background: #fde2e4; }

/* ---------------------------------------------------------------- alert rules */
.al-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1em; align-items: start; }
.al-side { padding: 0; overflow: hidden; position: sticky; top: 1em; }
.al-side-head { display: flex; align-items: center; gap: .6em; padding: .7em .9em; border-bottom: 1px solid var(--border); font-weight: 500; }
.al-side-head input { margin-left: auto; width: 150px; padding: .3em .5em; font-size: .9em; }
.al-list { max-height: calc(100vh - 11em); overflow: auto; }
.al-rule { display: flex; gap: .7em; align-items: flex-start; padding: .65em .9em; border-bottom: 1px solid var(--border); cursor: pointer; }
.al-rule:last-child { border-bottom: 0; }
.al-rule:hover { background: #f1f6fa; }
.al-rule.sel { background: #e3eff8; box-shadow: inset 3px 0 0 var(--primary); }
.al-rule-main { min-width: 0; flex: 1; }
.al-rule .nm { font-weight: 500; display: flex; gap: .5em; align-items: center; }
.al-rule .meta { color: var(--muted); font-size: .8em; margin-top: .15em; }
.al-rule .meta .danger { color: var(--danger); }
.al-rule .dest { display: flex; gap: .3em; margin-top: .35em; flex-wrap: wrap; }
.tagx { font-size: .72em; background: #eef2f7; color: #475569; border-radius: 5px; padding: .1em .5em; font-weight: 600; }
.tagx.on { background: #dff6ef; color: #0f766e; }
.al-switch { width: 32px; height: 18px; border-radius: 999px; background: #cbd5e1; position: relative; flex: none; margin-left: auto; cursor: pointer; margin-top: .2em; }
.al-switch.on { background: var(--success); }
.al-switch.draft { background: #e5e7eb; border: 1px dashed #9ca3af; box-sizing: border-box; }
.al-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.al-switch.on::after { left: 16px; }
.al-switch.draft::after { top: 1px; left: 1px; }
.al-switch.small { width: 26px; height: 15px; margin: 0 0 0 .6em; }
.al-switch.small::after { width: 11px; height: 11px; }
.al-switch.small.on::after { left: 13px; }
.al-empty { padding: 1.5em; color: var(--muted); text-align: center; }
.al-empty.big { padding: 4em 1em; }
.al-empty.big .icon { width: 36px; height: 36px; stroke: var(--border); fill: none; stroke-width: 1.5; }
.page-header h1 svg { width: .9em; height: .9em; stroke: var(--primary); fill: none; stroke-width: 2; vertical-align: -.08em; margin-right: .15em; }
.al-editor { padding: 0; }
.al-sec { padding: 1em 1.25em; border-bottom: 1px solid var(--border); }
.al-sec:last-of-type { border-bottom: 0; }
.al-sec h4 { margin: 0 0 .25em; font-size: 1em; display: flex; align-items: center; gap: .6em; }
.al-sec h4 .n { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .75em; flex: none; }
.al-sec .hint { color: var(--muted); margin: 0 0 .8em 2.1em; font-size: .85em; }
.al-sec .fld { margin: 0 0 .8em 2.1em; }
.al-sec .fld > label { display: block; font-weight: 500; margin-bottom: .25em; font-size: .9em; }
.al-sec .fld .sub { color: var(--muted); font-size: .8em; margin-top: .25em; }
.al-sec .fld input[type=text], .al-sec .fld input[type=search], .al-sec .fld select, .al-sec .fld textarea { width: 100%; max-width: 560px; }
.al-sec select.al-sit { max-width: 560px; }
.al-radio { display: flex; gap: 1.2em; flex-wrap: wrap; margin-bottom: .4em; font-size: .92em; }
.al-radio label { display: inline-flex; align-items: center; gap: .35em; }
.al-selbody { margin-top: .3em; }
.inline-list { display: flex; gap: 1em; flex-wrap: wrap; }
.dcard { border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 .7em 2.1em; max-width: 760px; background: #fff; }
.dcard > .hd { display: flex; align-items: center; gap: .6em; padding: .55em .8em; font-weight: 500; cursor: pointer; }
.dcard > .hd .icon { width: 16px; height: 16px; stroke: var(--primary); fill: none; stroke-width: 2; }
.dcard > .hd .remove { color: var(--muted); font-size: 1.2em; line-height: 1; padding: 0 .2em; margin-left: .3em; }
.dcard > .hd .remove:hover { color: var(--danger); }
.dcard > .bd { display: none; padding: .2em .8em .6em; border-top: 1px solid var(--border); }
.dcard.open > .bd { display: block; }
.dcard .fld { margin-left: 0; }
.al-conds .dcard > .hd { cursor: default; }
.al-tags { display: flex; flex-wrap: wrap; gap: .3em; }
.mt { font: 600 .78em var(--mono, ui-monospace, Menlo, monospace); background: #f1f5f9; border: 1px solid var(--border); border-radius: 5px; padding: .15em .45em; cursor: pointer; }
.mt:hover { background: #e3eff8; border-color: var(--primary); }
.mt.sit { background: #dff6ef; border-color: #9fdcc8; color: #0f766e; }
.al-acts-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 1em; }
.al-acts-grid > div > label { display: block; font-weight: 500; margin-bottom: .25em; font-size: .9em; }
.al-preview { display: flex; flex-direction: column; gap: .6em; }
.al-prev-card { background: #eef6ff; border: 1px solid #cfe3f7; border-radius: var(--radius); padding: .6em .8em; font-size: .88em; }
.al-prev-card .hd { font-weight: 600; margin-bottom: .3em; }
.al-prev-card .to { color: var(--muted); font-size: .9em; }
.al-prev-card .subj { font-weight: 500; margin: .2em 0; }
.al-prev-card .body { white-space: pre-wrap; line-height: 1.45; }
.warnbox { background: #fdebd3; border: 1px solid #f3d9a8; border-radius: 6px; padding: .5em .7em; font-size: .85em; margin: .3em 0 .5em; }
.al-bar { padding: .8em 1.25em; border-top: 1px solid var(--border); margin: 0; }
@media (max-width: 1000px) { .al-wrap { grid-template-columns: 1fr; } .al-side { position: static; } .al-acts-grid { grid-template-columns: 1fr; } .dcard { margin-left: 0; } .al-sec .fld, .al-sec .hint { margin-left: 0; } }

/* map: grouped assets, asset popup, base-layer switch */
.asset-cluster { background: none; border: 0; }
.asset-cluster svg { display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,.35)); }
.asset-cluster b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.5); pointer-events: none; }
.asset-popup h3 { margin: 0 0 6px; font-size: 16px; text-align: center; display: flex; gap: 8px; justify-content: center; align-items: center; }
.asset-popup hr { border: 0; border-top: 1px solid var(--border, #ddd); margin: 8px 0; }
.asset-popup .pp-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 4px 0; font-size: 13px; }
.asset-popup .badge { background: #1f3953; color: #fff; border-radius: 6px; padding: 1px 8px; font-weight: 700; }
.asset-popup .pp-actions { display: flex; gap: 8px; margin-top: 10px; }
.asset-popup .pp-actions .btn { flex: 1; justify-content: center; text-decoration: none; }
.leaflet-control-layers { font: 13px/1.4 inherit; }
.asset-popup h3 svg { width: 20px; height: 20px; flex: none; }
.asset-popup .pp-chart { margin: 6px 0; }
.asset-popup .pp-bar { display: grid; grid-template-columns: 110px 1fr 28px; gap: 6px; align-items: center; font-size: 12px; margin: 3px 0; }
.asset-popup .pp-bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-popup .pp-bar .bar { background: rgba(0,0,0,.07); border-radius: 4px; height: 10px; overflow: hidden; }
.asset-popup .pp-bar .bar i { display: block; height: 100%; border-radius: 4px; }
.asset-popup .pp-bar .n { text-align: right; font-weight: 600; }
