:root {
  /* ── ScoutWired brand ── */
  --or: #ed7806;
  --pu: #4d2178;
  --or-l: #fef3e8;
  --pu-l: #f0eaf6;
  --or-m: #fad9b3;
  --pu-m: #c9aee3;
  --or-d: #b85c04;
  --pu-d: #341554;

  /* ── Semantic colours ── */
  --green: #639922;
  --green-l: #C0DD97;
  --green-bg: #eaf3de;
  --red: #E24B4A;
  --red-l: #fde8e8;
  --amber: #EF9F27;
  --amber-l: #faeeda;

  /* ── Neutrals ── */
  --bg: #f4f3f7;
  --surface: #ffffff;
  --border: #e4e1ec;
  --border2: #cdc8dc;
  --text: #1a1625;
  --text2: #6b6480;
  --text3: #9d97b0;

  /* ── Typography ── */
  --font: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;

  /* ── Spacing / radius ── */
  --r: 8px;
  --rl: 12px;
  --rx: 16px;

  /* ── Layout ── */
  --header-h: 54px;
  --toolbar-h: 48px;
  --nav-h: 56px;
  --sidebar-w: 210px;
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
}

body { overflow: hidden; }

@media (max-width: 768px) {
  body { overflow: auto; }
}

button, [role="button"], .ni, .mni, .tab, .popt { cursor: pointer; }

a { color: inherit; text-decoration: none; }

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
  font-family: var(--font);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.1s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--pu);
}

textarea { resize: vertical; min-height: 80px; }

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

::selection { background: var(--pu-l); color: var(--pu); }

/* ── SHELL LAYOUT ───────────────────────────────────────── */
.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

@media (max-width: 768px) {
  .shell { height: 100dvh; }
  .body { overflow: hidden; }
  .main { overflow: hidden; }
  .content { overflow-y: auto; flex: 1; }
}

/* ── HEADER ──────────────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: var(--pu);
  border-bottom: 2px solid var(--pu-d);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  flex-shrink: 0;
  z-index: 100;
}

.hlogo img {
  mix-blend-mode: screen;
  height: 44px;
  margin-top: 4px;
}
.hsw img { height: 38px; }
.hsw {
  margin-left: auto;
}

.hevent-pill {
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.hexec-badge {
  background: rgba(237,120,6,0.18);
  color: var(--or);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .hevent-pill { display: none; }
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-section {
  padding: 10px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
}

.ni {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  border-radius: 0;
  transition: all 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.ni i { font-size: 16px; flex-shrink: 0; }

.ni:hover {
  background: var(--pu-l);
  color: var(--pu);
}

.ni.active {
  background: var(--or);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: pointer;
  min-height: 66px;
}

.sidebar-footer:hover {
  background: var(--pu-l);
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pu), var(--or));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 10px;
  color: var(--text3);
}

.sidebar-user-role.exec { color: var(--or); }

.sidebar-user-meta {
  min-width: 0;
  flex: 1;
}

.sidebar-team-badges {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.team-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--badge-color);
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.team-badge i { font-size: 10px; }

.sidebar-user-popover {
  display: none;
  position: fixed;
  width: 300px;
  z-index: 650;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 14px;
  box-shadow: 0 10px 34px rgba(26,22,37,0.22);
}

.sidebar-user-popover.open { display: block; }

@media (max-width: 768px) {
  .sidebar { display: none; }
}

/* ── MOBILE NAV ──────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
}

.mobile-nav-inner {
  display: flex;
  height: 100%;
}

.mni {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  border: none;
  background: none;
  padding: 6px 4px;
  transition: color 0.1s;
}

.mni i { font-size: 20px; }

.mni.active { color: var(--or); }

.mobile-nav-hamburger a {
  display: contents;
}

.mobile-nav-hamburger button {
  min-width: 0;
}

.mobile-menu-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 620;
  background: rgba(26,22,37,0.4);
  align-items: flex-end;
}

.mobile-menu-panel.open { display: flex; }

.mobile-menu-sheet {
  width: 100%;
  max-height: min(78vh, 620px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--rx) var(--rx) 0 0;
  padding: 14px 0 18px;
  box-shadow: 0 -12px 34px rgba(26,22,37,0.22);
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.mobile-menu-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.mobile-menu-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.mobile-menu-section {
  padding: 12px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
}

.mobile-menu-sheet .ni {
  padding: 10px 16px;
}

@media (max-width: 768px) {
  .mobile-nav { display: block; }
  .content { padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); }
}

/* ── TOOLBAR ─────────────────────────────────────────────── */
.toolbar {
  height: var(--toolbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.page-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--pu);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .tb-tag { display: none; }
  .btn-text { display: none; }
}

@media (max-width: 768px) {
  .toolbar {
    height: auto;
    min-height: var(--toolbar-h);
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 6px;
  }
  .toolbar-left { flex: 1 1 100%; flex-wrap: wrap; }
  .toolbar-right { flex: 0 0 auto; flex-wrap: wrap; }
  .toolbar-left select { max-width: 140px; min-width: 0; width: auto; }
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}

.btn:hover { border-color: var(--border2); background: var(--bg); }

.btn-or {
  background: var(--or);
  color: #fff;
  border-color: var(--or);
}
.btn-or:hover { background: var(--or-d); border-color: var(--or-d); }

.btn-pu {
  background: var(--pu);
  color: #fff;
  border-color: var(--pu);
}
.btn-pu:hover { background: var(--pu-d); border-color: var(--pu-d); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text2);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--border); }

.btn-warn {
  background: var(--red-l);
  color: var(--red);
  border-color: var(--red-l);
}
.btn-warn:hover { border-color: var(--red); }

.btn i { font-size: 15px; }

@media (max-width: 768px) {
  .btn { padding: 7px 10px; }
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--rl);
  padding: 15px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.card-link {
  font-size: 12px;
  color: var(--pu);
  cursor: pointer;
}

/* ── METRIC CARDS ────────────────────────────────────────── */
.metric {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--rl);
  padding: 15px;
}

.metric-label {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
  margin-bottom: 6px;
}

.metric-val {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.metric-sub {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
}

.metric-sub .up { color: var(--green); }
.metric-sub .warn { color: var(--amber); }
.metric-sub .bad { color: var(--red); }

/* ── GRID HELPERS ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

@media (max-width: 768px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 500px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ── STATUS BADGES ───────────────────────────────────────── */
.estatus {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}

.es-sched { background: var(--bg); color: var(--text2); }
.es-next  { background: var(--or-l); color: var(--or); }
.es-live  { background: var(--red-l); color: var(--red); }
.es-done  { background: var(--green-bg); color: var(--green); }
.es-cancel { background: var(--bg); color: var(--text3); text-decoration: line-through; }

/* ── CHIPS ───────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text2);
}

.chip-lead { background: var(--pu-l); color: var(--pu); }
.chip-me   { background: var(--or-l); color: var(--or); }
.chip-warn { background: var(--red-l); color: var(--red); }

/* ── INLINE TAGS ─────────────────────────────────────────── */
.itag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.itag-or     { background: var(--or-l); color: var(--or); }
.itag-pu     { background: var(--pu-l); color: var(--pu); }
.itag-green  { background: var(--green-bg); color: var(--green); }
.itag-red    { background: var(--red-l); color: var(--red); }
.itag-amber  { background: var(--amber-l); color: var(--amber); }
.itag-grey   { background: var(--bg); color: var(--text2); }

/* ── PERIOD BANNER ───────────────────────────────────────── */
.period-banner {
  background: linear-gradient(135deg, #4d2178, #7b3fb8);
  border-radius: var(--rl);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  margin-bottom: 16px;
}

.period-banner-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.period-banner-info { flex: 1; }

.period-banner-title {
  font-size: 14px;
  font-weight: 600;
}

.period-banner-sub {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

.period-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #fff;
  transition: all 0.1s;
}

.banner-btn:hover { background: rgba(255,255,255,0.15); }
.banner-btn-primary { background: var(--or); border-color: var(--or); }
.banner-btn-primary:hover { background: var(--or-d); }

@media (max-width: 600px) {
  .period-banner { flex-wrap: wrap; }
  .period-banner-actions { width: 100%; }
}

/* ── STAFFING BARS ───────────────────────────────────────── */
.staffing-bar-wrap { margin-bottom: 8px; }

.staffing-bar-label {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
}

.staffing-bar-track {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.staffing-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.staffing-green { background: var(--green); }
.staffing-amber { background: var(--amber); }
.staffing-red   { background: var(--red); }

/* ── AVAILABILITY GRID ───────────────────────────────────── */
.avail-grid-row {
  display: grid;
  gap: 2px;
  margin-bottom: 2px;
}

.avail-cell {
  height: 18px;
  border-radius: 3px;
}

.avail-cell-available { background: #C0DD97; }
.avail-cell-maybe     { background: #fad9b3; }
.avail-cell-unavail   { background: #fde8e8; }
.avail-cell-none      { background: var(--bg); border: 1px solid var(--border); }

/* ── AVAILABILITY CALENDAR ───────────────────────────────── */
.cal-wrap {
  display: flex;
  overflow: hidden;
  height: 100%;
}

.cal-gutter {
  width: 48px;
  flex-shrink: 0;
  padding-top: 36px;
}

.cal-gutter-hour {
  height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  position: relative;
  top: -6px;
}

.cal-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

@media (max-width: 500px) {
  .cal-days { grid-template-columns: repeat(2, 1fr); }
  .cal-gutter { width: 36px; }
}

.cal-day-header {
  padding: 8px 6px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
}

.cal-day-num {
  font-size: 22px;
  font-weight: 600;
  color: var(--pu);
  line-height: 1;
}

.cal-day-num.muted { color: var(--text3); }

.cal-day-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text2);
  margin-top: 1px;
}

.cal-day-col {
  border-right: 1px solid var(--border);
  position: relative;
}

.cal-day-col:last-child { border-right: none; }

.cal-hour {
  height: 44px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.cal-half {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--border);
  opacity: 0.5;
}

.cal-block {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 4px;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  z-index: 5;
}

.cal-block-available {
  background: var(--green-bg);
  border: 1.5px solid var(--green);
  color: var(--green);
}

.cal-block-maybe {
  background: var(--or-l);
  border: 1.5px solid var(--or);
  color: var(--or-d);
}

.cal-block-blockout {
  background: #3d3d3d;
  border: 1.5px solid #2a2a2a;
  color: #ccc;
  cursor: not-allowed;
  z-index: 4;
}

.cal-block-preview {
  background: var(--pu-l);
  border: 1.5px dashed var(--pu-m);
  opacity: 0.5;
  pointer-events: none;
  z-index: 6;
}

.cal-resize-handle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 6px;
  background: #fff;
  border-radius: 3px;
  cursor: ns-resize;
  opacity: 0.8;
}

.cal-resize-top { top: 3px; }
.cal-resize-bottom { bottom: 3px; }

.cal-unavail-overlay {
  position: absolute;
  inset: 0;
  background: rgba(226,75,74,0.08);
  pointer-events: none;
  z-index: 3;
}

/* ── TABLES ──────────────────────────────────────────────── */
.data-table {
  display: grid;
  width: 100%;
}

.dt-head {
  display: contents;
}

.dt-head-cell {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text2);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.dt-row {
  display: contents;
}

.dt-row > div {
  padding: 9px 8px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.dt-row:last-child > div { border-bottom: none; }

/* Standard HTML table styling for accessibility tables */
.acc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

table.acc-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text2);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

table.acc-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}

table.acc-table tr:last-child td { border-bottom: none; }

/* ── POPUP / MODAL ───────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,22,37,0.4);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--rx);
  padding: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .overlay.open { align-items: flex-end; }

  .modal {
    border-radius: var(--rx) var(--rx) 0 0;
    max-width: 100%;
    margin: 0;
  }
}

/* ── FORM FIELDS ─────────────────────────────────────────── */
.form-group { margin-bottom: 12px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── TOASTS ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: calc(100vw - 32px);
}

@media (max-width: 768px) {
  .toast-container { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); right: 12px; left: 12px; align-items: center; }
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toast-in 0.2s ease;
}

.toast-success { background: var(--green); color: #fff; }
.toast-error   { background: var(--red); color: #fff; }
.toast-info    { background: var(--pu); color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── TABS ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.1s;
}

.tab:hover { color: var(--pu); }
.tab.active { color: var(--or); border-bottom-color: var(--or); }

/* ── EMPTY STATES ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text3);
  gap: 8px;
}

.empty-state i { font-size: 32px; }
.empty-state p { font-size: 13px; }

/* ── SKELETON ────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── TOGGLE SWITCH ───────────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle {
  width: 48px;
  height: 26px;
  background: var(--border2);
  border-radius: 13px;
  position: relative;
  transition: background 0.25s ease;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.toggle:hover { background: var(--text3); }
.toggle.on { background: var(--or); }
.toggle.on:hover { background: var(--or-d); }

.toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05);
}

/* Use transform instead of left for smoother animation */
.toggle.on .toggle-thumb { transform: translateX(22px); }
.toggle.on::before { transform: translateX(22px); }

.toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 9px;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  transition: opacity 0.2s;
}
.toggle.on::after { opacity: 0; }

.toggle-wrap { gap: 10px; align-items: center; }

.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  user-select: none;
}

/* ── AVAILABILITY TYPE POPUP ─────────────────────────────── */
.avail-popup {
  background: var(--surface);
  border-radius: var(--rx);
  padding: 16px;
  max-width: 280px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.avail-popup-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.avail-popup-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.1s;
}

.avail-popup-opt:hover { border-color: var(--border2); background: var(--bg); }

.avail-popup-opt.opt-available:hover { border-color: var(--green); background: var(--green-bg); }
.avail-popup-opt.opt-maybe:hover     { border-color: var(--or); background: var(--or-l); }

.avail-popup-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.dot-available { background: var(--green); }
.dot-maybe     { background: var(--or); }

.avail-popup-opt-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.avail-popup-opt-desc {
  font-size: 11px;
  color: var(--text2);
}

/* Communications */
.comms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  padding: 16px;
}

.comms-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 14px;
  min-width: 0;
}

.comms-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.comms-title {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.comms-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text3);
}

.comms-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .comms-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }
}

/* ── LOADING SCREEN ──────────────────────────────────────── */
#app-loading {
  position: fixed;
  inset: 0;
  background: var(--pu);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

#app-loading.al-out { opacity: 0; pointer-events: none; }

.al-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.al-logo {
  height: 52px;
  mix-blend-mode: screen;
  animation: al-pulse 2s ease-in-out infinite;
}

.al-spinner {
  display: flex;
  gap: 8px;
}

.al-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: al-bounce 1.2s ease-in-out infinite;
}

.al-dot:nth-child(2) { animation-delay: 0.2s; }
.al-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes al-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%       { opacity: 1;    transform: scale(1.04); }
}

@keyframes al-bounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.4; }
  40%            { transform: translateY(-8px); opacity: 1; }
}

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
  .sidebar, .mobile-nav, .toolbar, .header { display: none !important; }
  body { overflow: visible; background: white; color: black; }
  .shell, .main { height: auto; overflow: visible; }
  .content { overflow: visible; }
  .card { border: 1px solid #ccc; page-break-inside: avoid; }
  @page { margin: 20mm; }
}

/* ── MISC ────────────────────────────────────────────────── */
.section-gap { margin-bottom: 20px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.text-muted { color: var(--text2); }
.text-small { font-size: 11px; }
.mono { font-family: var(--mono); }
.no-wrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.warn-inline { color: var(--red); font-size: 11px; display: flex; align-items: center; gap: 4px; }
