/* ============================================================
   orc-iviu-theme.css  –  Partner-matched design for ORC UI
   ============================================================ */

/* ── Design tokens (mirrors iviu-partner) ───────────────────────────────── */
:root {
  --orc-brand:        #2189D0;
  --orc-brand-dark:   #1a72b8;
  --orc-ink:          #0f172a;
  --orc-ink-muted:    #475569;
  --orc-surface:      #f8fafc;
  --orc-card:         #ffffff;
  --orc-accent:       #F07F21;
  --orc-input-bg:     #ffffff;
  --orc-input-border: #b8d8f0;
}

/* ── Base typography ────────────────────────────────────────────────────── */
html {
  font-size: 16px;  /* 120% of prior 13px base — scales all rem units up */
}

body, html {
  font-family: "Roboto", "Gill Sans", "Trebuchet MS", sans-serif;
  color: var(--orc-ink);
  background: var(--orc-surface) !important;  /* remove the blue banner image */
}

/* Remove text glow effects globally to keep typography flat and crisp. */
body *,
html * {
  text-shadow: none !important;
}

/* Content containers: sit flush just below the 52px fixed navbar */
#location_container {
  padding-top: 56px !important;
}

#nav_container {
  padding-top: 100px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Override the util.css pixel-fixed fs-* classes to match the smaller scale */
.fs-20 { font-size: 15px !important; }
.fs-24 { font-size: 16px !important; }
.fs-18 { font-size: 14px !important; }
.fs-16 { font-size: 13px !important; }
.fs-15 { font-size: 13px !important; }

/* Compact form controls to fit single-line layouts */
.form-control {
  font-size: 0.8rem !important;
  padding: 0.25rem 0.5rem !important;
  height: calc(1.5em + 0.5rem + 2px) !important;
  line-height: 1.5 !important;
}

/* Compact buttons */
.btn {
  font-size: 0.8rem !important;
  padding: 0.25rem 0.65rem !important;
  line-height: 1.5 !important;
}

/* select2 must match form-control size */
.select2-container--default .select2-selection--single {
  height: calc(1.5em + 0.5rem + 2px) !important;
  font-size: 0.8rem !important;
  line-height: 1.5 !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: calc(1.5em + 0.5rem) !important;
  font-size: 0.8rem !important;
  padding-left: 0.5rem !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: calc(1.5em + 0.5rem) !important;
}

/* Table cells — compact rows that don't wrap */
.table td, .table th {
  padding: 0.3rem 0.6rem !important;
  white-space: nowrap;
}
.table thead th {
  font-size: 0.75rem !important;
  padding: 0.3rem 0.6rem !important;
}

/* ── DataTables sort indicators — match Partner Status list style ──────── */
table.dataTable > thead > tr > th {
  background: #2189D0 !important;
  color: #fff !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  border-bottom: none !important;
  white-space: nowrap;
}
table.dataTable > thead > tr > th:not(.sorting_disabled) {
  padding-right: 1.6em !important;
}
/* replace ↑↓ pseudo-element arrows with ▲▼ */
table.dataTable > thead .sorting::before,
table.dataTable > thead .sorting_asc::before,
table.dataTable > thead .sorting_desc::before,
table.dataTable > thead .sorting_asc_disabled::before,
table.dataTable > thead .sorting_desc_disabled::before { content: "\25b2"; font-size: 0.65em; opacity: 0.35; right: 0.9em; }
table.dataTable > thead .sorting::after,
table.dataTable > thead .sorting_asc::after,
table.dataTable > thead .sorting_desc::after,
table.dataTable > thead .sorting_asc_disabled::after,
table.dataTable > thead .sorting_desc_disabled::after  { content: "\25bc"; font-size: 0.65em; opacity: 0.35; right: 0.3em; }
table.dataTable > thead .sorting_asc::before  { opacity: 0.85; }
table.dataTable > thead .sorting_desc::after  { opacity: 0.85; }
table.dataTable > thead .sorting_asc,
table.dataTable > thead .sorting_desc { text-decoration: underline; }
table.dataTable > thead .sorting_asc_disabled::before,
table.dataTable > thead .sorting_desc_disabled::after  { opacity: 0; }
table.dataTable > thead > tr > th.sorting:hover,
table.dataTable > thead > tr > th.sorting_asc:hover,
table.dataTable > thead > tr > th.sorting_desc:hover { background: #1a72b8 !important; cursor: pointer; user-select: none; }

/* Location table rows are directly clickable — show pointer cursor */
#location_table tbody tr {
  cursor: pointer;
}

/* ── Sub-nav bar (location name + tabs, fixed below navbar) ─────────────── */
#orc-sub-nav {
  position:   fixed;
  top:        52px;
  left:       0;
  right:      0;
  z-index:    99;
  background: #ffffff;
  border-bottom: 1px solid rgba(33, 137, 208, 0.18);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.orc-sub-nav-inner {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             0;
  padding:         0 16px;
  min-height:      44px;
}

.orc-sub-nav-loc {
  display:     flex;
  align-items: center;
  flex:        1 1 auto;
  min-width:   0;
  padding-right: 14px;
  margin-right: 14px;
  border-right: 1px solid rgba(33, 137, 208, 0.18);
}

a.orc-sub-nav-loc-link {
  font-size:       13px;
  font-weight:     600;
  color:           var(--orc-ink) !important;
  white-space:     nowrap;
  overflow:        hidden;
  text-overflow:   ellipsis;
  max-width:       100%;
  text-decoration: none;
}

a.orc-sub-nav-loc-link:hover {
  color:           var(--orc-brand) !important;
  text-decoration: underline;
}

.orc-sub-nav-tabs {
  display:     flex;
  align-items: center;
  gap:         4px;
  flex-wrap:   nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── DataTable toolbar (title/filter left, search right) ─────────────────── */
.orc-dt-toolbar {
  display:     flex;
  align-items: center;
  margin-bottom: 0.4rem;
}

.orc-dt-toolbar .dt-buttons {
  display:     flex;
  align-items: center;
  gap:         4px;
  flex:        0 0 auto;
}

/* Back button pushes CSV/Excel to the right within .dt-buttons */
.orc-dt-toolbar .dt-buttons .orc-dt-back,
.orc-dt-toolbar .dt-buttons .btn:first-child:not(.loc-filter-btn) {
  margin-right: auto !important;
}

.orc-dt-toolbar .ml-auto {
  margin-left: auto !important;
}

.orc-dt-toolbar .dataTables_filter {
  float:  none !important;
  margin: 0 !important;
}

.orc-dt-toolbar .dataTables_filter label {
  margin:    0 !important;
  display:   flex;
  align-items: center;
  gap:       0.35rem;
  font-size: 0.78rem;
}

/* Location table title heading */
.orc-loc-title {
  font-size:   1rem;
  font-weight: 700;
  color:       var(--orc-ink);
  white-space: nowrap;
  display:     flex;
  align-items: center;
  margin-right: 16px;
  flex-shrink: 0;
}

/* Background-loading indicator shown next to the title */
.orc-loc-loading {
  font-size:   0.72rem;
  font-weight: 400;
  color:       var(--orc-ink-muted, #888);
  margin-left: 8px;
  opacity:     0.8;
}

/* Filter label */
.orc-filter-label {
  font-size:   0.78rem;
  font-weight: 400;
  color:       var(--orc-ink);
  white-space: nowrap;
  display:     flex;
  align-items: center;
  padding-right: 6px;
}

/* Location filter buttons — 3 explicit state buttons */
.loc-filter-btn {
  font-size:     0.72rem !important;
  font-weight:   600 !important;
  padding:       0.22rem 0.75rem !important;
  border-radius: 999px !important;
  line-height:   1.5 !important;
  border:        1px solid var(--orc-brand) !important;
  background:    transparent !important;
  color:         var(--orc-brand) !important;
  transition:    background 0.15s, color 0.15s !important;
  white-space:   nowrap;
}

.loc-filter-btn.loc-filter-selected,
.orc-dt-toolbar .dt-buttons button.loc-filter-btn.loc-filter-selected {
  background:   var(--orc-brand) !important;
  border-color: var(--orc-brand) !important;
  color:        #ffffff !important;
}

/* Event devices filter buttons (All / Visitors Only) — same pill style */
.filter-all-edt-button.btn,
.filter-visitor-edt-button.btn {
  border:        1px solid var(--orc-brand) !important;
  color:         var(--orc-brand) !important;
  background:    transparent !important;
  border-radius: 999px !important;
  font-size:     0.72rem !important;
  font-weight:   600 !important;
  padding:       0.22rem 0.75rem !important;
  line-height:   1.5 !important;
  transition:    background 0.15s, color 0.15s !important;
  white-space:   nowrap;
}

.filter-all-edt-button.btn.active,
.filter-visitor-edt-button.btn.active {
  background:   var(--orc-brand) !important;
  border-color: var(--orc-brand) !important;
  color:        #ffffff !important;
}

/* Alerts toolbar: status -> filters -> search -> exports (same sizing/style) */
.orc-alert-status,
.orc-alert-filters,
.orc-alert-search,
.orc-alert-exports {
  display: flex;
  align-items: center;
}

.orc-toolbar-btn {
  height: 30px !important;
  padding: 0.32rem 0.78rem !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  border-radius: 0.45rem !important;
  border: 1px solid rgba(33, 137, 208, 0.45) !important;
  background: #ffffff !important;
  color: var(--orc-brand) !important;
  white-space: nowrap;
}

.orc-toolbar-btn.orc-toolbar-selected {
  background: var(--orc-brand) !important;
  border-color: var(--orc-brand) !important;
  color: #ffffff !important;
}

.orc-toolbar-status {
  color: #5f6b78 !important;
  border-color: rgba(95, 107, 120, 0.35) !important;
  background: #f7f9fb !important;
  pointer-events: none;
}

.orc-alert-search .dataTables_filter {
  margin: 0 !important;
}

.orc-alert-search .dataTables_filter label {
  margin: 0 !important;
  font-size: 0 !important;
}

.orc-alert-search .dataTables_filter input {
  height: 30px;
  min-width: 220px;
  margin-left: 0 !important;
  font-size: 0.74rem !important;
  border: 1px solid rgba(33, 137, 208, 0.45) !important;
  border-radius: 0.45rem !important;
  padding: 0.32rem 0.62rem !important;
  color: var(--orc-ink) !important;
  background: #ffffff !important;
}

.orc-alert-exports .dt-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.orc-alert-exports .dt-buttons .btn {
  height: 30px !important;
  padding: 0.32rem 0.78rem !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  border-radius: 0.45rem !important;
  border: 1px solid rgba(33, 137, 208, 0.45) !important;
  background: #ffffff !important;
  color: var(--orc-brand) !important;
}

.orc-alert-exports .dt-buttons .btn:hover,
.orc-toolbar-btn:hover {
  background: #eaf4fb !important;
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
#navbar.navbar {
  background:    #ffffff !important;
  border-bottom: 2px solid var(--orc-brand) !important;
  box-shadow:    0 1px 6px rgba(15, 23, 42, 0.10) !important;
  padding:       0 !important;
  min-height:    52px;
}

/* Full-width inner flex row */
.orc-nav-inner {
  display:     flex;
  align-items: center;
  width:       100%;
  min-height:  52px;
}

/* ── Left: logo + app title ─────────────────────────────────────────────── */
.orc-nav-logo {
  display:      flex;
  align-items:  center;
  gap:          12px;
  padding:      0 16px;
  border-right: 1px solid rgba(33, 137, 208, 0.15);
  flex-shrink:  0;
  min-height:   52px;
}

#header_logo {
  height: 40px;
  width: auto;
  display: block;
}

.orc-nav-appname {
  font-size:      16px;
  font-weight:    600;
  color:          var(--orc-ink) !important;
  white-space:    nowrap;
  letter-spacing: 0.01em;
}

.orc-nav-appname {
  font-size:      16px;
  font-weight:    600;
  color:          var(--orc-ink) !important;
  white-space:    nowrap;
  letter-spacing: 0.01em;
}

/* orc-nav-centre removed — tabs moved to #orc-sub-nav */

#navbar_title {
  pointer-events: none;
}

/* ── Nav tab buttons ────────────────────────────────────────────────────── */
.nav_header_button.btn {
  background:    transparent !important;
  color:         var(--orc-ink-muted) !important;
  border:        1px solid rgba(33, 137, 208, 0.22) !important;
  border-radius: 0.45rem !important;
  font-size:     0.78rem !important;
  font-weight:   500 !important;
  padding:       3px 10px !important;
  height:        28px !important;
  line-height:   1 !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
  box-shadow:    none !important;
}

.nav_header_button.btn:hover {
  background:    rgba(33, 137, 208, 0.09) !important;
  border-color:  var(--orc-brand) !important;
  color:         var(--orc-ink) !important;
}

.nav_header_button.btn.active,
.nav_header_button.btn:active {
  background:    var(--orc-brand) !important;
  border-color:  var(--orc-brand) !important;
  color:         #ffffff !important;
  box-shadow:    0 2px 8px rgba(33, 137, 208, 0.35) !important;
}

/* Add button: outlined brand colour, left separator gap */
.orc-tab-add.btn {
  margin-left:   8px !important;
  border-color:  var(--orc-brand) !important;
  color:         var(--orc-brand) !important;
  width:         28px !important;
  padding:       3px 0 !important;
}

.orc-tab-add.btn:hover {
  background:  rgba(33, 137, 208, 0.12) !important;
}

/* Edit / Delete: icon-only, grey, fade when disabled */
.orc-tab-icon.btn {
  width:       28px !important;
  padding:     3px 0 !important;
}

/* ── Right: text+icon buttons (Back / Refresh / Sign out) ──────────────── */
.orc-nav-right {
  display:     flex;
  align-items: center;
  gap:         6px;
  padding:     0 16px;
  flex-shrink: 0;
  margin-left: auto;
  border-left: 1px solid rgba(33, 137, 208, 0.12);
}

/* Keep old icon-btn rule so it doesn't break if referenced elsewhere */
.orc-nav-icon-btn.btn {
  background:    transparent !important;
  border:        1px solid rgba(33, 137, 208, 0.22) !important;
  border-radius: 0.45rem !important;
  color:         var(--orc-ink-muted) !important;
  width:         32px !important;
  height:        32px !important;
  padding:       0 !important;
  line-height:   30px !important;
  text-align:    center !important;
  transition:    background 0.15s, color 0.15s !important;
  box-shadow:    none !important;
}

/* New text+icon buttons */
.orc-nav-text-btn.btn {
  background:    transparent !important;
  border:        1px solid rgba(33, 137, 208, 0.25) !important;
  border-radius: 0.45rem !important;
  color:         var(--orc-ink-muted) !important;
  height:        32px !important;
  padding:       0 10px !important;
  font-size:     0.78rem !important;
  font-weight:   500 !important;
  white-space:   nowrap !important;
  display:       inline-flex !important;
  align-items:   center !important;
  gap:           5px !important;
  transition:    background 0.15s, border-color 0.15s, color 0.15s !important;
  box-shadow:    none !important;
}

.orc-nav-text-btn.btn:hover {
  background:   rgba(33, 137, 208, 0.09) !important;
  border-color: var(--orc-brand) !important;
  color:        var(--orc-ink) !important;
}

#theme_toggle_btn {
  min-width: 114px;
  justify-content: center;
}

.orc-nav-icon-btn.btn:hover {
  background:   rgba(33, 137, 208, 0.09) !important;
  border-color: var(--orc-brand) !important;
  color:        var(--orc-ink) !important;
}

/* ── Primary buttons ────────────────────────────────────────────────────── */
.btn-primary {
  background-color: var(--orc-brand) !important;
  border-color:     var(--orc-brand) !important;
  color:            #ffffff !important;
  font-weight:      600 !important;
  letter-spacing:   0.02em !important;
  transition:       background 0.15s, border-color 0.15s !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--orc-brand-dark) !important;
  border-color:     var(--orc-brand-dark) !important;
}

/* ── Secondary buttons ──────────────────────────────────────────────────── */
.btn-secondary:not(.nav_header_button) {
  background-color: transparent !important;
  border:           1px solid rgba(15, 23, 42, 0.25) !important;
  color:            var(--orc-ink-muted) !important;
  font-weight:      500 !important;
  transition:       background 0.15s, border-color 0.15s, color 0.15s !important;
}

.btn-secondary:not(.nav_header_button):hover {
  background-color: rgba(15, 23, 42, 0.06) !important;
  border-color:     rgba(15, 23, 42, 0.4) !important;
  color:            var(--orc-ink) !important;
}

/* ── Danger button ──────────────────────────────────────────────────────── */
.btn-danger {
  background-color: #dc2626 !important;
  border-color:     #dc2626 !important;
  color:            #ffffff !important;
}

.btn-danger:hover {
  background-color: #b91c1c !important;
  border-color:     #b91c1c !important;
}

/* ── Login page button ──────────────────────────────────────────────────── */
.login100-form-btn {
  background-color: var(--orc-brand) !important;
  border-radius:    0.5rem !important;
  font-family:      "Roboto", Ubuntu-Bold, sans-serif !important;
  letter-spacing:   0.04em !important;
}

.login100-form-btn:hover {
  background-color: var(--orc-brand-dark) !important;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table thead th {
  background:     var(--orc-brand) !important;
  color:          #ffffff !important;
  border-bottom:  none !important;
  font-weight:    600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(33, 137, 208, 0.03) !important;
}

.table-striped tbody tr:nth-of-type(even) {
  background-color: #ffffff !important;
}

.table tbody tr:hover td {
  background: rgba(33, 137, 208, 0.07) !important;
}

.table td, .table th {
  border-bottom:    1px solid rgba(15, 23, 42, 0.07) !important;
  color:            var(--orc-ink) !important;
  vertical-align:   middle !important;
}

/* DataTables pagination / filter overrides */
/* DataTables pagination — compact, small font */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  font-size: 0.08rem !important;
  padding: 0.08rem 0.35rem !important;
  line-height: 1.4 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background:    var(--orc-brand) !important;
  border-color:  var(--orc-brand) !important;
  color:         #ffffff !important;
  border-radius: 0.35rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background:    rgba(33, 137, 208, 0.12) !important;
  border-color:  var(--orc-brand) !important;
  color:         var(--orc-brand) !important;
  border-radius: 0.35rem !important;
}

/* Row highlight / select */
tr.highlight, tr.highlight td {
  background-color: rgba(33, 137, 208, 0.08) !important;
}

tr.select, tr.select td {
  background-color: rgba(33, 137, 208, 0.22) !important;
}

/* ── Form controls ──────────────────────────────────────────────────────── */
.form-control {
  background:    var(--orc-input-bg) !important;
  border-color:  #c8d9ea !important;
  color:         var(--orc-ink) !important;
  border-radius: 0.4rem !important;
  transition:    border-color 0.15s !important;
  font-family:   "Roboto", Ubuntu-Regular, sans-serif !important;
}

.form-control:focus {
  border-color: var(--orc-brand) !important;
  box-shadow:   0 0 0 0.18rem rgba(33, 137, 208, 0.2) !important;
}

.form-control:disabled {
  background: rgba(15, 23, 42, 0.04) !important;
  color:      var(--orc-ink-muted) !important;
}

/* ── Main content area: flat/flush, no card window ──────────────────────── */
#nav_container .white,
#location_container .white {
  background: var(--orc-card) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.75rem 1.25rem !important;
}

/* ── Dialog / modal cards ───────────────────────────────────────────────── */
#busy_container .white,
#event_form_container .white,
#release_mob_container .white,
#release_mob_alert_container .white,
#edit_release_container .white,
#user_form_container .white,
#event_filter_container .white,
#out_location_container .white {
  border-radius: 0.9rem !important;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.22) !important;
}

/* ── Footer text ────────────────────────────────────────────────────────── */
#footer, #login_footer {
  color: var(--orc-ink-muted) !important;
  font-size: 0.82rem !important;
}

/* ── btn-group "radio" tabs (Alert Delivery, User Type, etc.) ───────────── */
.btn-group-toggle .btn {
  border-radius: 0.4rem !important;
  font-weight:   500 !important;
}

.btn-group-toggle .btn-secondary.active {
  background-color: var(--orc-brand) !important;
  border-color:     var(--orc-brand) !important;
  color:            #ffffff !important;
}

/* ── Edit + Delete fade when nothing selected; Add disappears when N/A ───── */
/* Edit / Delete: smooth fade (keep space in row) */
#edit_radio,
#delete_radio {
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

#edit_radio.disabled,
#delete_radio.disabled {
  opacity:        0 !important;
  visibility:     hidden !important;
  pointer-events: none !important;
}

/* Add: completely removed from layout when not applicable on this tab */
#action_radio.disabled {
  display:        none !important;
}

/* ── Rules form ─────────────────────────────────────────────────────────── */

/* Outer container – add breathing room and a max-width */
#rule_form_container {
  max-width: 960px;
  padding: 0.5rem 1rem 2rem;
}

/* Back button bar above forms (Rules) — matches DataTable toolbar spacing */
.orc-back-bar {
  padding: 0.4rem 0 0.8rem;
}

/* Each named section block */
.rule-section {
  margin-bottom: 0.75rem;
}

/* Section heading – blue underline strip matching partner style */
.rule-section-title-row {
  display:        flex;
  align-items:    center;
  justify-content: space-between;
  padding-bottom: 0.4rem;
  border-bottom:  2px solid var(--orc-brand);
  margin-bottom:  1rem;
}

.rule-section-title-row .rule-section-title {
  padding-bottom: 0;
  border-bottom:  none;
  margin-bottom:  0;
}

.orc-refresh-btn {
  font-size:      0.72rem;
  padding:        0.2rem 0.55rem;
  color:          var(--orc-brand);
  border:         1px solid var(--orc-brand);
  background:     transparent;
  border-radius:  4px;
  line-height:    1.4;
  white-space:    nowrap;
  cursor:         pointer;
}
.orc-refresh-btn:hover {
  background: var(--orc-brand);
  color:      #fff;
}

.rule-section-title {
  font-size:      0.82rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color:          var(--orc-brand);
  padding-bottom: 0.4rem;
  border-bottom:  2px solid var(--orc-brand);
  margin-bottom:  1rem;
}

/* Auto-fill grid: 4 columns on wide screens, collapses nicely */
.rule-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem 1rem;
}

@media (max-width: 900px)  { .rule-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px)  { .rule-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .rule-grid { grid-template-columns: 1fr; } }

/* A single label+input cell */
.rule-field {
  display:        flex;
  flex-direction: column;
  gap:            0.22rem;
}

/* Span all columns (e.g. for the radio group row) */
.rule-field-full {
  grid-column: 1 / -1;
}

/* Two-column span */
.rule-field-half {
  grid-column: span 2;
}

/* Field label */
.rule-field-label {
  font-size:      10px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color:          var(--orc-ink-muted);
  margin-bottom:  0;
  display:        block;
  white-space:    nowrap;
}

/* Status row (read-only inputs): lighter background label */
.rule-field-status .rule-field-label {
  color: var(--orc-ink-muted);
}

.rule-field-status .form-control {
  background: rgba(15, 23, 42, 0.035) !important;
  color:      var(--orc-ink-muted) !important;
}

/* Save button row */
.rule-save-row {
  padding-top: 1.25rem;
  border-top:  1px solid rgba(15, 23, 42, 0.08);
  margin-top:  0.5rem;
}

/* ── Rule Slider ───────────────────────────────────────────── */

/* Nav bar: prev arrow | tabs | next arrow */
.rule-slider-nav {
  display:         flex;
  align-items:     center;
  gap:             0.4rem;
  margin-bottom:   0.65rem;
}

.rule-slide-arrow {
  flex-shrink:     0;
  background:      none;
  border:          1px solid var(--orc-brand);
  color:           var(--orc-brand);
  font-size:       1.3rem;
  line-height:     1;
  width:           28px;
  height:          28px;
  border-radius:   4px;
  cursor:          pointer;
  padding:         0;
  display:         flex;
  align-items:     center;
  justify-content: center;
  transition:      background 0.15s, color 0.15s;
}
.rule-slide-arrow:hover {
  background: var(--orc-brand);
  color:      #fff;
}
.rule-slide-arrow:disabled {
  opacity:    0.35;
  cursor:     default;
}

/* Tab strip */
.rule-slide-tabs {
  display:   flex;
  gap:       0.25rem;
  flex-wrap: wrap;
}

.rule-slide-tab {
  background:    none;
  border:        1px solid transparent;
  border-radius: 4px;
  color:         var(--orc-ink-muted);
  font-size:     0.72rem;
  font-weight:   600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding:       3px 10px;
  cursor:        pointer;
  white-space:   nowrap;
  transition:    background 0.15s, color 0.15s, border-color 0.15s;
}
.rule-slide-tab:hover {
  background:    rgba(15,23,42,0.06);
  border-color:  var(--orc-brand);
  color:         var(--orc-brand);
}
.rule-slide-tab.active {
  background:    var(--orc-brand);
  border-color:  var(--orc-brand);
  color:         #fff;
}

/* Panel tab view – only the active slide is shown */
.rule-slider-viewport {
  /* no clipping needed in panel mode */
}

.rule-slider-track {
  /* no flex layout in panel mode */
}

.rule-slide {
  display: none;
}

.rule-slide.active {
  display: block;
}

/* Admin-only fields: hidden by default, shown via JS for user_type=0 */
.rule-admin-only { display: none; }

/* ── Dark mode ──────────────────────────────────────────────────────────── */
body.dark-mode {
  --orc-surface:      #0f1d35;
  --orc-card:         #152240;
  --orc-ink:          #e2e8f0;
  --orc-ink-muted:    #94a3b8;
  --orc-input-bg:     #1a2d4c;
  --orc-input-border: #2d4a7a;
  background: var(--orc-surface) !important;
}

body.dark-mode #location_container,
body.dark-mode #nav_container,
body.dark-mode #location_form,
body.dark-mode #nav_form,
body.dark-mode .container-login100,
body.dark-mode .limiter {
  background: var(--orc-surface) !important;
}

body.dark-mode #navbar.navbar {
  background: #0c1a30 !important;
}

body.dark-mode #orc-sub-nav {
  background: #0c1a30 !important;
  border-bottom-color: rgba(33,137,208,0.22) !important;
}

body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255,255,255,0.03) !important;
}
body.dark-mode .table-striped tbody tr:nth-of-type(even) {
  background-color: var(--orc-card) !important;
}
body.dark-mode .table td, body.dark-mode .table th {
  border-bottom-color: rgba(255,255,255,0.07) !important;
}
body.dark-mode .table tbody tr:hover td {
  background: rgba(33,137,208,0.14) !important;
}

body.dark-mode .white {
  background: var(--orc-card) !important;
}

/* Alert detail readability in dark mode: avoid light bootstrap surfaces with light text. */
body.dark-mode .bg-light,
body.dark-mode .card.bg-light,
body.dark-mode .alert.alert-light {
  background: rgba(15, 35, 63, 0.9) !important;
  color: var(--orc-ink) !important;
  border-color: rgba(59, 130, 246, 0.28) !important;
}

body.dark-mode #alert_detail_container {
  background: var(--orc-card) !important;
  border-color: rgba(59, 130, 246, 0.28) !important;
}

body.dark-mode #alert_detail_meta .text-muted,
body.dark-mode #alert_attention_summary .text-muted,
body.dark-mode .alert-section-header .section-help {
  color: #cbd5e1 !important;
}

body.dark-mode .form-control:disabled {
  background: rgba(255,255,255,0.05) !important;
}

body.dark-mode .rule-field-status .form-control {
  background: rgba(255,255,255,0.05) !important;
}

body.dark-mode .rule-save-row {
  border-top-color: rgba(255,255,255,0.10) !important;
}

body.dark-mode .btn-secondary:not(.nav_header_button) {
  border-color: rgba(255,255,255,0.20) !important;
}
body.dark-mode .btn-secondary:not(.nav_header_button):hover {
  background-color: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.38) !important;
}

/* Select2 dark overrides */
body.dark-mode .select2-container--default .select2-selection--single {
  background: var(--orc-input-bg) !important;
  border-color: var(--orc-input-border) !important;
}
body.dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--orc-ink) !important;
}
body.dark-mode .select2-dropdown {
  background: var(--orc-card) !important;
  border-color: var(--orc-input-border) !important;
}
body.dark-mode .select2-container--default .select2-results__option {
  color: var(--orc-ink) !important;
}
body.dark-mode .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--orc-brand) !important;
  color: #fff !important;
}
body.dark-mode .select2-container--default .select2-search--dropdown .select2-search__field {
  background: var(--orc-input-bg) !important;
  border-color: var(--orc-input-border) !important;
  color: var(--orc-ink) !important;
}

/* DateRange picker dark overrides */
body.dark-mode .daterangepicker {
  background: var(--orc-card) !important;
  border-color: var(--orc-input-border) !important;
  color: var(--orc-ink) !important;
}
body.dark-mode .daterangepicker .calendar-table {
  background: var(--orc-card) !important;
  border-color: transparent !important;
}
body.dark-mode .daterangepicker td.in-range {
  background: rgba(33,137,208,0.18) !important;
  color: var(--orc-ink) !important;
}
body.dark-mode .daterangepicker td.active,
body.dark-mode .daterangepicker td.active:hover {
  background: var(--orc-brand) !important;
  color: #fff !important;
}
body.dark-mode .daterangepicker td:not(.active):hover {
  background: rgba(33,137,208,0.14) !important;
}
body.dark-mode .daterangepicker .drp-buttons {
  border-top-color: rgba(255,255,255,0.10) !important;
}

/* Login container dark */
body.dark-mode .limiter {
  background: var(--orc-surface) !important;
}
body.dark-mode .wrap-login100 {
  background: var(--orc-card) !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5) !important;
}

/* ── POI / Bad Actor location table indicators ──────────────────────────── */
.loc-poi-badge {
    font-size: 0.68rem;
    padding: 0.18rem 0.45rem;
    white-space: nowrap;
}

.loc-alert-icon {
    font-size: 1.05rem;
}

.loc-alert-active {
    color: #dc3545;
}

.loc-alert-investigating {
    color: #ffc107;
}

/* ── Alert Detail Panel ─────────────────────────────────────────────────── */
#alert_detail_container .alert-detail-header {
    border-bottom: 2px solid var(--orc-brand);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

#alert_device_table th,
#alert_device_table td {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
}

#alert_workspace {
  margin-top: 0.1rem;
}

#alert_table_pane,
#alert_detail_pane {
  min-width: 0;
}

#alert_detail_container {
  border: 1px solid rgba(33, 137, 208, 0.16);
  border-radius: 6px;
  padding: 0.65rem;
  background: #fff;
}

.alert-devices-card,
.alert-insights-card {
  border: 1px solid rgba(33, 137, 208, 0.18);
  box-shadow: none;
}

/* Non-red emphasis: use subtle brand accent bar instead of danger border. */
.alert-devices-card {
  border-left: 4px solid rgba(33, 137, 208, 0.55);
}

.alert-section-header {
  background: var(--orc-surface, #f8f9fa);
  color: var(--orc-ink, #0f172a);
  border-bottom: 1px solid rgba(33, 137, 208, 0.12);
  font-size: 0.87rem;
}

.alert-section-header .section-help {
  color: #6c757d;
}

.iinsights-result-title {
  font-size: 0.85rem;
  color: var(--orc-brand);
}

#alert_detail_meta .card {
  height: 100%;
  border: 1px solid rgba(33, 137, 208, 0.12);
  box-shadow: none;
}

#alert_detail_meta .table td {
  white-space: normal;
  vertical-align: top;
}

#alert_device_table {
  table-layout: auto;
}

#alert_device_table tbody tr {
  cursor: pointer;
}

/* ── Journal ────────────────────────────────────────────────────────────── */
#journal_entries {
    background: var(--orc-surface, #f8f9fa);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 0.5rem;
}

.journal-entry {
    background: var(--orc-card, #fff);
    border: 1px solid rgba(0,0,0,0.08) !important;
    font-size: 0.82rem;
}

body.dark-mode #journal_entries {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .journal-entry {
    background: rgba(255,255,255,0.06) !important;
    border-color: rgba(255,255,255,0.1) !important;
}

/* ── ARGUS Panel ────────────────────────────────────────────────────────── */
#argus_container .iinsights-query-btn {
    min-width: 160px;
    text-align: left;
}

#iinsights_result_panel thead th {
    font-size: 0.78rem;
    background: var(--orc-brand);
    color: #fff;
}

#iinsights_result_panel td {
    font-size: 0.80rem;
}

#iinsights_result_panel tbody tr:hover td {
    background: inherit;
}

#iinsights_result_panel {
    user-select: none !important;
    -webkit-user-select: none !important;
}
#iinsights_result_panel * {
    user-select: none !important;
    -webkit-user-select: none !important;
}
#iinsights_result_panel td,
#iinsights_result_panel button,
#iinsights_result_panel span {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.iscout-device-link:focus,
.iscout-device-link:focus-visible,
.iscout-device-link:active {
    outline: none !important;
    box-shadow: none !important;
}

  border-radius: 8px;
  padding: 7px;
}

.iinsights-selected-device {
  border: 1px solid rgba(33, 137, 208, 0.24);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  color: #334155;
}

.iinsights-selected-device .label {
  color: #64748b;
  font-weight: 600;
  margin-right: 0.25rem;
}

.iinsights-selected-device .value {
  font-weight: 600;
  color: #0f172a;
}

.iinsights-selected-device .status-authorized {
  color: #0f5132;
}

.iinsights-selected-device .status-not-authorized {
  color: #7f1d1d;
}

.iinsights-query-groups {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.iinsights-query-groups .iinsights-query-group {
  flex: 1 1 280px;
  min-width: 0;
}

.iinsights-query-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.iinsights-query-separator {
  width: 1px;
  background: linear-gradient(to bottom, rgba(33, 137, 208, 0.05), rgba(33, 137, 208, 0.35), rgba(33, 137, 208, 0.05));
  border-radius: 1px;
}

.iinsights-query-row {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.iinsights-query-row-all {
  border: 1px solid #d9e8f6;
  border-radius: 8px;
  padding: 7px;
  background: #f8fafc;
}

.iinsights-query-row .btn {
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Keep debug SQL/query print hidden in UI. */
#iinsights_query_preview {
  display: none !important;
}

.iinsights-query-row .btn.iiq-selected {
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08), 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.iinsights-query-row .btn-outline-primary.iiq-selected {
  background: #0d6efd;
  color: #fff;
}

.iinsights-query-row .btn-outline-success.iiq-selected {
  background: #198754;
  color: #fff;
}

.iinsights-query-row .btn-outline-secondary.iiq-selected {
  background: #6c757d;
  color: #fff;
}

#alert_device_table tbody tr.table-primary td {
  background-color: #cfe8ff !important;
}

body.dark-mode #alert_device_table tbody tr.table-primary td {
  background-color: rgba(59, 130, 246, 0.45) !important;
  color: #f8fafc !important;
  border-bottom-color: rgba(147, 197, 253, 0.55) !important;
}

body.dark-mode #alert_device_table tbody tr td {
  color: #e5e7eb !important;
}

body.dark-mode .alert-devices-card,
body.dark-mode .alert-insights-card {
  background: #132542 !important;
  border-color: rgba(96, 165, 250, 0.35) !important;
}

body.dark-mode .alert-devices-card .card-body,
body.dark-mode .alert-insights-card .card-body {
  background: transparent !important;
  color: #e5e7eb !important;
}

body.dark-mode .alert-section-header {
  background: #10213d !important;
  color: #e5e7eb !important;
  border-bottom-color: rgba(96, 165, 250, 0.3) !important;
}

body.dark-mode #iinsights_result_panel .table {
  color: #e5e7eb !important;
}

body.dark-mode #iinsights_result_panel .table thead.thead-light th {
  background: #1f3f69 !important;
  color: #f8fafc !important;
  border-bottom-color: rgba(147, 197, 253, 0.55) !important;
}

body.dark-mode #iinsights_result_panel .table tbody tr td {
  border-bottom-color: rgba(148, 163, 184, 0.3) !important;
}

body.dark-mode #iinsights_result_panel .table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.18) !important;
}

.iinsights-query-group-events {
  border-left: 4px solid #0d6efd;
  background: #f7fbff;
}

.iinsights-query-group-visits {
  border-left: 4px solid #198754;
  background: #f8fffb;
}

.iinsights-query-group-muted {
  border-left: 4px solid #6c757d;
  background: #f8f9fa;
}

body.dark-mode .iinsights-selected-device {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(15, 35, 63, 0.7);
  color: #cbd5e1;
}

body.dark-mode .iinsights-selected-device .label {
  color: #94a3b8;
}

body.dark-mode .iinsights-selected-device .value {
  color: #e2e8f0;
}

body.dark-mode .iinsights-selected-device .status-authorized {
  color: #86efac;
}

body.dark-mode .iinsights-selected-device .status-not-authorized {
  color: #fca5a5;
}

body.dark-mode .iinsights-query-group {
  border-color: rgba(59, 130, 246, 0.35);
}

body.dark-mode .iinsights-query-group-events {
  background: rgba(8, 47, 73, 0.45);
}

body.dark-mode .iinsights-query-group-visits {
  background: rgba(6, 78, 59, 0.4);
}

body.dark-mode .iinsights-query-group-muted {
  background: rgba(71, 85, 105, 0.35);
}

body.dark-mode .iinsights-query-group-label {
  color: #cbd5e1;
}

body.dark-mode .iinsights-query-row .btn {
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.45);
}

body.dark-mode .iinsights-query-row .btn-outline-secondary {
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.55);
}

body.dark-mode .iinsights-query-separator {
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.08), rgba(96, 165, 250, 0.45), rgba(59, 130, 246, 0.08));
}

@media (max-width: 1200px) {
  .iinsights-query-separator {
    display: none;
  }
}

/* ── iScout — iViu Insights Investigation Assistant ──────────────────────── */
.iscout-btn {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 1200;
  background: linear-gradient(135deg, var(--orc-brand) 0%, #1558a0 100%);
  color: #fff;
  border-radius: 26px;
  padding: 11px 18px 11px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(33,137,208,0.5);
  font-weight: 700;
  font-size: 0.82rem;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.02em;
}
.iscout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(33,137,208,0.6);
}
.iscout-btn-icon { font-size: 1rem; }

/* Keep floating assistant from covering investigation rows; use in-pane launch button. */
#iscoutBtn {
  opacity: 0.92;
  max-width: 220px;
}

body.orc-investigating #iscoutBtn {
  display: inline-flex !important;
}

.iscout-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: var(--orc-accent);
  border-radius: 50%;
  border: 2px solid #fff;
  animation: iscout-pulse 2s ease-in-out infinite;
}
@keyframes iscout-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.35); opacity: 0.7; }
}

.iscout-panel {
  position: fixed;
  bottom: 82px;
  right: 22px;
  z-index: 1199;
  width: min(620px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 110px));
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(12, 35, 64, 0.24), 0 2px 10px rgba(12, 35, 64, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #8db5da;
  animation: iscout-slide-in 0.2s ease-out;
}
@keyframes iscout-slide-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.iscout-header {
  background: linear-gradient(135deg, #0a4f93 0%, #1172c6 58%, #1b8ed3 100%);
  color: #fff;
  padding: 14px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  cursor: move;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.iscout-header-left { display: flex; align-items: center; gap: 10px; }
.iscout-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.iscout-title      { font-weight: 800; font-size: 1rem; line-height: 1.2; }
.iscout-ai-badge   { background: rgba(255,255,255,0.25); border-radius: 4px; padding: 1px 5px; font-size: 0.6rem; font-weight: 700; letter-spacing: .06em; vertical-align: middle; }
.iscout-subtitle   { font-size: 0.7rem; opacity: 0.78; }
.iscout-close      { background: none; border: none; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; opacity: 0.75; padding: 0 3px; }
.iscout-close:hover{ opacity: 1; }

body.iscout-dragging,
body.iscout-dragging * {
  user-select: none !important;
}

.iscout-device-ctx {
  background: linear-gradient(90deg, rgba(17,114,198,0.10) 0%, rgba(17,114,198,0.04) 100%);
  border-bottom: 1px solid rgba(17,114,198,0.22);
  padding: 7px 13px;
  font-size: 0.72rem;
  color: var(--orc-ink, #0f172a);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.iscout-device-ctx .iscout-ctx-label { font-weight: 700; color: var(--orc-brand); }

.iscout-env-bar {
  background: rgba(15,23,42,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 5px 13px;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.72);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.iscout-env-bar span { white-space: nowrap; }

.iscout-quick-launch {
  padding: 7px 10px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(17,114,198,0.18);
  background: linear-gradient(180deg, rgba(17,114,198,0.06) 0%, rgba(17,114,198,0.02) 100%);
  flex-shrink: 0;
}

.iscout-launch-btn {
  border: 1px solid rgba(17,114,198,0.30);
  background: #ffffff;
  color: #0b4f8f;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.iscout-launch-btn:hover,
.iscout-launch-btn:focus {
  outline: none;
  transform: translateY(-1px);
  border-color: #1172c6;
  background: #1172c6;
  color: #fff;
}

.iscout-launch-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  background: #eef4fb;
  color: #5b6f86;
  border-color: rgba(91,111,134,0.34);
}

.iscout-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
}
.iscout-msg {
  max-width: 90%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  line-height: 1.55;
  word-break: break-word;
}
.iscout-msg.scout {
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: #0c223b;
  border: 1px solid rgba(17,114,198,0.20);
}
.iscout-msg.user  { background: var(--orc-brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.iscout-msg-time  { font-size: 0.63rem; opacity: 0.5; margin-top: 4px; }

.iscout-thinking {
  align-self: flex-start;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--orc-brand) 9%, var(--orc-card, #fff));
  border-radius: 12px 12px 12px 4px;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--orc-brand);
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(33,137,208,0.12);
}
.iscout-thinking-dots span {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--orc-brand);
  animation: iscout-dot-bounce 1.2s ease-in-out infinite;
}
.iscout-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.iscout-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes iscout-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-5px); opacity: 1; }
}

.iscout-chips {
  padding: 5px 10px 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex-shrink: 0;
}
/* Predefined query buttons (icon + label, shown on device open) */
.iscout-qbtn {
  background: linear-gradient(180deg, #ffffff 0%, #f0f7ff 100%);
  color: #0a4f93;
  border: 1px solid rgba(17,114,198,0.34);
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: transform 0.12s, background 0.12s, color 0.12s, border-color 0.12s;
}
.iscout-qbtn:hover {
  transform: translateY(-1px);
  background: #1172c6;
  color: #fff;
  border-color: #1172c6;
}
/* Follow-up suggestion chips */
.iscout-chip {
  background: #ecf5ff;
  color: #0a4f93;
  border: 1px solid rgba(17,114,198,0.30);
  border-radius: 14px;
  padding: 3px 11px;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s, background 0.1s, border-color 0.1s;
}
.iscout-chip:hover { transform: translateY(-1px); background: #dceeff; border-color: rgba(17,114,198,0.45); }
.iscout-empty-state { color: #aaa; font-size: 0.78rem; padding: 10px 2px; }

.iscout-help-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.iscout-help-intro {
  font-size: 0.76rem;
  color: #183956;
  line-height: 1.45;
}

.iscout-help-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 4px;
}

.iscout-help-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0a4f93;
  text-transform: uppercase;
}

.iscout-help-qbtn {
  text-align: left;
  border: 1px solid rgba(17,114,198,0.28);
  background: #f4f9ff;
  color: #0b3d6d;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 0.73rem;
  line-height: 1.35;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}

.iscout-help-qbtn:hover {
  transform: translateY(-1px);
  background: #e8f3ff;
  border-color: rgba(17,114,198,0.45);
}

.iscout-input-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-top: 1px solid var(--orc-input-border, #b8d8f0);
  flex-shrink: 0;
}
.iscout-input {
  flex: 1;
  border: 1px solid var(--orc-input-border, #b8d8f0);
  border-radius: 20px;
  padding: 7px 13px;
  font-size: 0.8rem;
  background: var(--orc-input-bg, #fff);
  color: var(--orc-ink, #0f172a);
  outline: none;
  transition: border-color 0.15s;
}
.iscout-input:focus { border-color: var(--orc-brand); }
.iscout-send {
  background: linear-gradient(135deg, var(--orc-brand) 0%, #1558a0 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.iscout-send:hover { opacity: 0.88; }

/* ─── iScout result panel (structured data table inside floating panel) ─── */
.iscout-result-panel {
  border-top: 1px solid rgba(17,114,198,0.22);
  flex-shrink: 0;
  max-height: 210px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7fbff;
}
.iscout-result-header {
  padding: 5px 12px 2px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0a4f93;
  flex-shrink: 0;
}
.iscout-result-summary {
  padding: 0 12px 4px;
  font-size: 0.71rem;
  color: #6c757d;
  flex-shrink: 0;
}
.iscout-result-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 0 4px 4px;
}
.iscout-result-panel .table {
  font-size: 0.73rem;
  margin-bottom: 0;
}
.iscout-result-panel .table th {
  background: var(--orc-brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
.iscout-result-panel .table td {
  vertical-align: top;
  word-break: break-word;
}

#iscoutReopenBtn {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 1198;
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  display: none;
  cursor: move;
  user-select: none;
}

@media (max-width: 600px) {
  .iscout-panel { width: calc(100vw - 16px); right: 8px; bottom: 78px; }
  .iscout-btn   { right: 12px; bottom: 14px; }
  #iscoutReopenBtn { right: 10px; bottom: 10px; }
  .iscout-quick-launch {
    gap: 5px;
    padding: 6px 8px 5px;
  }
  .iscout-launch-btn {
    font-size: 0.66rem;
    padding: 3px 8px;
  }
}

/* Alert Device Motion modal (visit investigation) */
.orc-motion-modal {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 15%, rgba(33, 137, 208, 0.18), rgba(8, 27, 43, 0.72));
  z-index: 1300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 10px;
  overflow-y: auto;
}

.orc-motion-modal-dialog {
  width: min(1140px, 99vw);
  border: 1px solid rgba(33, 137, 208, 0.42);
  border-radius: 12px;
  overflow: hidden;
  background: var(--orc-card, #fff);
  box-shadow: 0 22px 60px rgba(3, 12, 22, 0.55), 0 2px 10px rgba(18, 60, 96, 0.25);
}

.orc-motion-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 10px;
}

.orc-motion-card {
  border: 1px solid rgba(136, 178, 210, 0.65);
  border-radius: 10px;
  background: linear-gradient(180deg, #fcfeff 0%, #f1f7fd 100%);
  padding: 8px;
  box-shadow: 0 1px 6px rgba(14, 35, 56, 0.12);
}

.orc-motion-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.orc-motion-card-title {
  font-weight: 700;
  color: var(--orc-brand);
}

.orc-motion-card-meta {
  font-size: 0.75rem;
  color: #506072;
}

.orc-motion-canvas {
  width: 100%;
  height: 456px;
  border: 1px solid #c9deef;
  border-radius: 8px;
  background: #f5fbff;
}

.orc-motion-canvas-wrap {
  position: relative;
}

.orc-motion-unit-meta {
  margin-top: 6px;
  padding: 5px 7px;
  background: #ffffff;
  border: 1px solid rgba(142, 176, 205, 0.68);
  border-radius: 6px;
}

.orc-motion-unit-meta-line {
  font-size: 0.72rem;
  color: #2d4256;
  line-height: 1.25;
  font-weight: 500;
}

.orc-motion-unit-meta-line + .orc-motion-unit-meta-line {
  margin-top: 2px;
}

.orc-motion-summary {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #415366;
}

@media (max-width: 768px) {
  .orc-motion-modal {
    padding: 8px;
    align-items: stretch;
  }
  .orc-motion-modal-dialog {
    width: 100%;
    min-height: calc(100vh - 16px);
  }
  .orc-motion-canvas {
    height: 420px;
  }
}

/* ============================================================
   iScout Crowd Learning — feedback bar + team intelligence chips
   ============================================================ */
.iscout-fb-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(0,0,0,0.07);
  font-size: 0.72rem;
  flex-wrap: wrap;
}
.iscout-fb-label {
  color: #607080;
  font-style: italic;
}
.iscout-fb-thanks {
  color: #2d7d46;
  font-style: italic;
}
.iscout-fb-up, .iscout-fb-down,
.iscout-fb-share-yes, .iscout-fb-share-no,
.iscout-fb-clarify-send {
  background: none;
  border: 1px solid #c8d6e0;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.72rem;
  cursor: pointer;
  color: #355870;
  transition: background 0.15s, border-color 0.15s;
}
.iscout-fb-up:hover, .iscout-fb-share-yes:hover, .iscout-fb-clarify-send:hover {
  background: #d4edda; border-color: #5bb47a;
}
.iscout-fb-down:hover, .iscout-fb-share-no:hover {
  background: #fde8e8; border-color: #e08080;
}
.iscout-fb-clarify { flex-direction: column; align-items: flex-start; gap: 5px; }
.iscout-fb-clarify-input {
  width: 100%;
  border: 1px solid #c8d6e0;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 0.76rem;
  color: #333;
  outline: none;
}
.iscout-fb-clarify-input:focus { border-color: var(--orc-brand); }

/* Crowd-contributed learnings chip area */
.iscout-crowd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 8px 4px;
  border-top: 1px dashed rgba(17,114,198,0.18);
  min-height: 0;
}
.iscout-crowd-chips:empty { display: none; }
.iscout-crowd-label {
  width: 100%;
  font-size: 0.66rem;
  color: #8a9bb0;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.iscout-crowd-chip {
  background: #f0f7ff;
  border-color: rgba(17,114,198,0.25) !important;
  color: #1172c6;
  font-size: 0.72rem;
  padding: 2px 9px;
}
.iscout-crowd-chip:hover {
  background: #dceeff;
  border-color: rgba(17,114,198,0.5) !important;
}
