@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f3f7fb;
  --bg-gradient:
    radial-gradient(circle at 9% -2%, #ffffff 0%, #ecf5ff 44%, transparent 65%),
    radial-gradient(circle at 92% 10%, #e6f4ff 0%, transparent 45%),
    linear-gradient(180deg, #f7fbff 0%, #eef3f9 100%);
  --card: rgba(255,255,255,0.94);
  --card-glass: rgba(255,255,255,0.96);
  --border: rgba(15,23,42,0.06);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f5ea8;
  --primary-dark: #0b4a86;
  --primary-soft: rgba(14,116,214,0.14);
  --accent: #0ea5a4;
  --glow1: rgba(14,116,214,0.2);
  --glow2: rgba(14,165,164,0.18);
  --code: #0f172a;
  --code-bg: rgba(15,23,42,0.06);
  --good:#059669;
  --bad:#dc2626;
  --shadow: 0 18px 40px rgba(31,41,55,0.12);
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

body.dark-mode {
  --bg: #0b0f1a;
  --bg-gradient:
    radial-gradient(circle at 10% 0%, #13213a 0%, transparent 45%),
    radial-gradient(circle at 86% 12%, #0f2c3a 0%, transparent 38%),
    linear-gradient(180deg, #0c1220 0%, #090f1a 100%);
  --card: rgba(12,16,28,0.92);
  --card-glass: rgba(16,20,34,0.94);
  --border: rgba(255,255,255,0.1);
  --text: #e2e8f0;
  --muted: #9aa7bd;
  --primary: #7ec6ff;
  --primary-dark: #42a4ff;
  --primary-soft: rgba(126,198,255,0.14);
  --accent: #34d399;
  --glow1: rgba(126,198,255,0.2);
  --glow2: rgba(52,211,153,0.14);
  --code: #e2e8f0;
  --code-bg: rgba(15,23,42,0.35);
  --good:#4ade80;
  --bad:#fb7185;
  --shadow:0 20px 46px rgba(0,0,0,0.45);
  background:var(--bg);
  background-image:var(--bg-gradient);
}

*,
*::before,
*::after{box-sizing:border-box}

img,
svg,
canvas,
video,
iframe{
  max-width:100%;
}

body{
  margin:0;
  font-family:'IBM Plex Sans', system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  background-image:var(--bg-gradient);
  line-height:1.45;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  position:relative;
  overflow-x:hidden;
}

h1, h2, h3, h4, h5{
  font-family:'Space Grotesk', 'IBM Plex Sans', system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  letter-spacing:-0.02em;
}

a,
button,
input,
select,
textarea{
  transition:border-color .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(14,116,214,0.2);
}

body.dark-mode a:focus-visible,
body.dark-mode button:focus-visible,
body.dark-mode input:focus-visible,
body.dark-mode select:focus-visible,
body.dark-mode textarea:focus-visible{
  box-shadow:0 0 0 3px rgba(126,198,255,0.28);
}

.app-shell{
  display:flex;
  flex-direction:row;
  min-height:100vh;
  width:100%;
}
.app-nav{
  width:clamp(224px, 18vw, 264px);
  min-width:224px;
  padding:18px 14px;
  border-right:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,255,0.9));
  backdrop-filter:blur(18px);
  position:sticky;
  top:0;
  height:100dvh;
  max-height:100dvh;
  align-self:flex-start;
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:hidden;
}
body.dark-mode .app-nav{
  background:linear-gradient(180deg, rgba(16,20,34,0.95), rgba(12,16,28,0.92));
}
.app-nav-footer{
  margin-top:auto;
  padding-top:10px;
  border-top:1px dashed rgba(15,23,42,0.08);
  flex:0 0 auto;
}
body.dark-mode .app-nav-footer{
  border-top-color:rgba(255,255,255,0.08);
}
.nav-user{
  font-size:12px;
  color:var(--muted);
  padding:7px 9px;
  border-radius:10px;
  background:rgba(255,255,255,0.7);
  border:1px solid var(--border);
  line-height:1.3;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.nav-user.dev-unlock{
  cursor:pointer;
  user-select:none;
}
body.dark-mode .nav-user{
  background:rgba(12,16,28,0.8);
}
.app-nav-head{
  display:flex;
  flex-direction:column;
  gap:5px;
  flex:0 0 auto;
}
.app-logo{
  width:30px;
  height:30px;
}
.app-nav-title{
  font-size:14px;
  font-weight:700;
  display:flex;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:6px;
  line-height:1.15;
  min-width:0;
}
.beta-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:9px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid rgba(79,70,229,0.28);
  background:rgba(79,70,229,0.12);
  color:var(--primary);
  line-height:1.2;
  text-decoration:none;
  transition:all .15s ease;
}
.beta-badge:hover{
  border-color:rgba(79,70,229,0.45);
  background:rgba(79,70,229,0.2);
}
.beta-badge:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(79,70,229,0.2);
}
body.dark-mode .beta-badge{
  border-color:rgba(129,140,248,0.45);
  background:rgba(129,140,248,0.2);
  color:#c7d2fe;
}
.app-nav-sub{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
}
.app-nav-links{
  display:flex;
  flex-direction:column;
  gap:4px;
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  scrollbar-width:thin;
  padding-right:4px;
}
.app-nav-links::-webkit-scrollbar{
  width:8px;
}
.app-nav-links::-webkit-scrollbar-thumb{
  background:rgba(100,116,139,0.35);
  border-radius:999px;
}
.app-nav-links::-webkit-scrollbar-track{
  background:transparent;
}
.nav-section{
  margin:8px 0 2px;
  padding:0 6px;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
}
.app-nav-links .tab{
  width:100%;
  justify-content:flex-start;
  background:transparent;
  border:1px solid transparent;
  border-radius:12px;
  padding:7px 9px;
  font-size:12px;
  line-height:1.15;
  color:var(--muted);
  box-shadow:none;
  position:relative;
  min-width:0;
  white-space:normal;
  text-align:left;
}
.app-nav-links .tab:hover{
  background:rgba(14,116,214,0.1);
  color:var(--primary);
}
.app-nav-links .tab.active{
  background:var(--primary-soft);
  color:var(--primary);
  box-shadow:none;
  font-weight:700;
}
.app-nav-links .tab.active::before{
  content:'';
  position:absolute;
  left:-8px;
  top:50%;
  transform:translateY(-50%);
  width:5px;
  height:60%;
  border-radius:4px;
  background:var(--primary);
}
@media (max-height: 900px){
  .app-nav{
    padding:14px 12px;
    gap:10px;
  }
  .app-logo{
    width:26px;
    height:26px;
  }
  .app-nav-title{
    font-size:13px;
    gap:5px;
  }
  .beta-badge{
    font-size:8px;
    padding:1px 5px;
  }
  .app-nav-sub,
  .nav-section{
    font-size:10px;
    letter-spacing:.1em;
  }
  .app-nav-links{
    gap:3px;
  }
  .app-nav-links .tab{
    padding:6px 8px;
    font-size:11px;
    border-radius:10px;
  }
  .nav-user{
    font-size:11px;
    padding:6px 8px;
  }
}
@media (max-height: 760px){
  .app-nav{
    padding:12px 10px;
    gap:8px;
  }
  .app-nav-head{
    gap:4px;
  }
  .app-nav-links .tab{
    padding:5px 7px;
    font-size:10.5px;
  }
  .nav-section{
    margin:6px 0 1px;
  }
  .app-nav-footer{
    padding-top:8px;
  }
}
.app-main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}
.app-topbar{
  position:sticky;
  top:14px;
  z-index:5;
  background:linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,250,255,0.85));
  border:1px solid rgba(15,23,42,0.08);
  padding:10px 18px;
  display:grid;
  grid-template-columns:1fr 1fr;
  align-items:center;
  gap:16px;
  backdrop-filter:blur(20px);
  border-radius:999px;
  box-shadow:0 18px 36px rgba(15,23,42,0.12);
  margin:0 auto;
  width:calc(100% - 48px);
  max-width:1200px;
}
body.topbar-has-search .app-topbar{
  grid-template-columns:1fr minmax(420px, 520px) 1fr;
}
body.dark-mode .app-topbar{
  background:linear-gradient(180deg, rgba(16,20,34,0.92), rgba(12,16,28,0.9));
  border-color:rgba(255,255,255,0.08);
}
.topbar-left{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-self:start;
}
.topbar-search{
  flex:1;
  max-width:520px;
  display:flex;
  gap:8px;
  align-items:center;
  position:relative;
  justify-self:center;
  width:100%;
}
.topbar-search input{
  width:100%;
  padding:11px 42px 11px 14px;
  border-radius:999px;
  border:1px solid rgba(14,116,214,0.18);
  background:linear-gradient(135deg, rgba(255,255,255,0.98), rgba(243,246,255,0.92));
  color:var(--text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 20px rgba(15,23,42,0.08);
}
body.dark-mode .topbar-search input{
  background:rgba(14,18,40,0.9);
  border-color:rgba(126,198,255,0.3);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 24px rgba(0,0,0,0.35);
}
.topbar-search input::placeholder{
  color:rgba(71,85,105,0.8);
}
.topbar-search::after{
  content:'';
  position:absolute;
  right:14px;
  width:18px;
  height:18px;
  opacity:0.5;
  background:
    radial-gradient(circle at 60% 40%, transparent 45%, currentColor 46% 52%, transparent 53%) no-repeat,
    linear-gradient(currentColor, currentColor) no-repeat;
  background-size:18px 18px, 2px 10px;
  background-position:center, 15px 15px;
  color:var(--muted);
  pointer-events:none;
}
.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  justify-self:end;
}
.topbar-left .status,
.topbar-right .pill{
  border-radius:999px;
}
.topbar-left .status{
  padding:6px 12px;
  font-size:12px;
}
.topbar-right .pill{
  padding:6px 14px;
  font-size:12px;
}
.topbar-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.8);
}
body.dark-mode .topbar-chip{
  background:rgba(12,16,28,0.8);
  border-color:rgba(255,255,255,0.08);
}
.topbar-chip .status{
  background:transparent;
  border:1px solid transparent;
  padding:4px 10px;
}
.app-topbar .pill{
  background:transparent;
  color:var(--text);
  border:1px solid var(--border);
  box-shadow:none;
}
.app-topbar .pill:hover{
  border-color:var(--primary);
  color:var(--primary);
}
.app-topbar .pill.logout{
  color:#b91c1c;
  border-color:rgba(185,28,28,0.2);
}
.app-topbar .pill.logout:hover{
  border-color:#fecaca;
  color:#b91c1c;
}
.app-content{
  flex:1;
  width:100%;
}

body::before,
body::after{
  content:'';
  position:fixed;
  width:480px;
  height:480px;
  filter:blur(140px);
  z-index:-2;
  opacity:0.28;
  pointer-events:none;
}
body::before{
  top:-220px;
  left:-140px;
  background:radial-gradient(circle at center,var(--glow1),#ffffff00 70%);
}
body::after{
  bottom:-240px;
  right:-160px;
  background:radial-gradient(circle at center,var(--glow2),#ffffff00 70%);
}
body::selection{background:rgba(96,165,250,0.22)}
body.dark-mode::selection{background:rgba(99,102,241,0.22)}

header{
  width:calc(100% - 48px);
  max-width:1260px;
  margin:32px auto 0;
  background:linear-gradient(180deg, rgba(255,255,255,0.96), rgba(249,250,255,0.9));
  border-radius:var(--radius-lg);
  padding:22px 32px 20px;
  border:1px solid rgba(15,23,42,0.08);
  box-shadow:0 24px 55px rgba(31,41,55,0.12);
  backdrop-filter:blur(20px);
  color:#0f172a;
}
body.dark-mode header{
  background:linear-gradient(180deg, rgba(16,20,34,0.96), rgba(12,16,28,0.92));
  color:var(--text);
  border-color:rgba(255,255,255,0.08);
}
.calendar-page header{
  max-width:none;
  width:calc(100% - 32px);
  padding:18px 26px 14px;
}
.calendar-page header .pill{
  padding:6px 12px;
  font-size:12px;
}
.calendar-page header h1{
  font-size:30px;
}

.status-row{
  display:flex;
  align-items:center;
  gap:18px;
}
.headline{
  display:grid;
  grid-template-columns:auto auto 1fr auto auto auto;
}
.headline-title{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}
.status-row h1{
  margin:0;
  text-align:center;
  font-size:34px;
  letter-spacing:-0.03em;
}

.incident-header{
  max-width:1200px;
  margin:0 auto;
  padding:22px 28px 8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
}
.incident-header-left{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.incident-header-left h1{
  margin:0;
  font-size:40px;
  letter-spacing:-0.03em;
}
.incident-header-right{
  display:flex;
  align-items:flex-end;
  gap:12px;
}
.incident-header-meta{
  display:flex;
  align-items:center;
  gap:8px;
}
.incident-header #open_main{
  opacity:0.8;
}

.detail-header{
  max-width:1200px;
  margin:0 auto;
  padding:22px 28px 8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
}
.detail-header-left{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.detail-header-left h1{
  margin:0;
  font-size:36px;
  letter-spacing:-0.03em;
}
.detail-header-right{
  display:flex;
  align-items:center;
  gap:12px;
}
.detail-header-meta{
  display:flex;
  align-items:center;
  gap:8px;
}
.detail-header #open_main{
  opacity:0.8;
}

.header-sub{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

header .sub{
  margin:0;
  color:rgba(15,23,42,0.7);
}
body.dark-mode header .sub{color:rgba(226,232,240,0.75)}

.status-group{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}

.status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 16px;
  border-radius:999px;
  font-size:13px;
  font-weight:600;
  background:rgba(79,70,229,0.1);
  border:1px solid rgba(79,70,229,0.2);
  color:var(--text);
}
.status.online{background:rgba(34,197,94,0.15);color:#15803d;border-color:rgba(34,197,94,0.25)}
.status.offline{background:rgba(239,68,68,0.15);color:#b91c1c;border-color:rgba(239,68,68,0.25)}
.user-chip{background:rgba(79,70,229,0.14);border-color:rgba(79,70,229,0.3);color:#4f46e5;cursor:pointer;box-shadow:0 6px 16px rgba(79,70,229,0.18)}
.calendar-icon{
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(79,70,229,0.12);
  border:1px solid rgba(79,70,229,0.2);
  color:var(--primary);
  text-decoration:none;
  line-height:1;
  transition:all .2s ease;
}
.calendar-icon svg{
  width:14px;
  height:14px;
  fill:currentColor;
  display:block;
}
.calendar-icon:hover{
  border-color:var(--primary);
  box-shadow:0 10px 20px rgba(79,70,229,0.18);
  transform:translateY(-1px);
}
body.dark-mode .calendar-icon{
  background:rgba(99,102,241,0.16);
  border-color:rgba(255,255,255,0.12);
  color:#a5b4fc;
}

.files-toolbar{
  margin-top:12px;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.files-toolbar input[type="file"]{
  max-width:240px;
}
.files-list{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.file-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
}
.file-row .file-info{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.file-row .file-title{
  font-weight:600;
}
.file-row .file-meta{
  font-size:12px;
  color:var(--muted);
}
.files-pagination{
  margin-top:12px;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.dev-stats-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:10px;
}
.dev-stat{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:var(--card);
  display:flex;
  flex-direction:column;
  gap:6px;
}
.dev-stat span{
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
}
.dev-stat strong{
  font-size:18px;
  font-weight:700;
}

.file-view-shell{
  width:100%;
  max-width:1200px;
  margin:0 auto 70px;
}
.file-view-page .headline{
  grid-template-columns:auto 1fr auto auto;
}
.file-view-page .headline-title{
  justify-self:center;
  text-align:center;
}
.file-view-page #file_title{
  text-align:center;
}
.file-view-card{
  padding:12px;
}
.file-summary-widget{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 14px;
  background:var(--card);
  margin-bottom:12px;
}
.file-tools-widget{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  background:var(--card);
  margin-bottom:12px;
}
.file-summary-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.preview-page{
  position:relative;
  width:100%;
}
.preview-page-image{
  width:100%;
  height:auto;
  border:1px solid var(--border);
  border-radius:10px;
  user-select:none;
  -webkit-user-drag:none;
  display:block;
}
.preview-annotations{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.preview-highlight-mark{
  position:absolute;
  background:rgba(255, 235, 59, 0.35);
  border:1px solid rgba(245, 158, 11, 0.65);
  border-radius:4px;
  box-shadow:0 0 0 1px rgba(255,255,255,0.2) inset;
}
.preview-highlight-mark.drawing{
  opacity:0.75;
}
.file-summary-body{
  font-size:14px;
  color:var(--text);
  line-height:1.5;
}
.file-progress{
  width:100%;
  height:8px;
  border-radius:999px;
  background:rgba(15,23,42,0.08);
  overflow:hidden;
  margin:6px 0 10px;
}
.file-progress-fill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, var(--primary), var(--accent));
  transition:width .4s ease;
}
body.dark-mode .file-progress{
  background:rgba(255,255,255,0.08);
}
.file-summary-widget .row{flex-wrap:wrap}
.file-frame-wrap{
  position:relative;
  width:100%;
  height:calc(100vh - 260px);
  min-height:480px;
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--border);
  background:var(--card);
}
.file-frame-wrap iframe{
  width:100%;
  height:100%;
  border:0;
  background:#fff;
}
.file-watermark{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:2;
  background-repeat:repeat;
  opacity:0.28;
}
.file-loading-overlay{
  position:absolute;
  inset:0;
  z-index:3;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:16px;
  text-align:center;
  background:linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.58));
  color:#0f172a;
  backdrop-filter:blur(2px);
}
body.dark-mode .file-loading-overlay{
  background:linear-gradient(180deg, rgba(12,16,28,0.72), rgba(12,16,28,0.62));
  color:#e2e8f0;
}
.file-loading-overlay.hidden{
  display:none;
}
.file-loading-spinner{
  width:38px;
  height:38px;
  border-radius:999px;
  border:3px solid rgba(15,23,42,0.2);
  border-top-color:var(--primary);
  animation:fileSpin .9s linear infinite;
}
body.dark-mode .file-loading-spinner{
  border-color:rgba(226,232,240,0.22);
  border-top-color:var(--primary);
}
.file-loading-text{
  font-weight:600;
  font-size:14px;
  max-width:460px;
}
@keyframes fileSpin{
  to { transform:rotate(360deg); }
}
.file-link-card{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 14px;
  background:var(--card);
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 16px;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:13px;
  font-weight:600;
  border:1px solid transparent;
  cursor:pointer;
  transition:all .2s ease;
}
.icon-btn{
  padding:6px 8px;
  font-size:14px;
  line-height:1;
}
.pill.active,
.pill.selected{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}
.pill:hover{border-color:var(--primary);box-shadow:0 10px 20px rgba(79,70,229,0.18)}
.pill.logout{background:rgba(248,113,113,0.15);color:#b91c1c}
.pill.logout:hover{border-color:#fecaca;background:#fff}
.pill.danger{background:rgba(239,68,68,0.12);color:#fee2e2;border-color:rgba(239,68,68,0.35)}
.ghost{background:transparent;border:1px solid var(--border);color:var(--muted)}
.pill.danger.ghost{background:rgba(248,113,113,0.12);color:#b91c1c;border-color:#fca5a5}
.icon-btn.danger{background:#ef4444;color:#fff;border-color:#ef4444}
.nova-recap{
  margin-top:6px;
}
.nova-recap-band{
  grid-column:1 / -1;
  margin-top:6px;
  margin-bottom:10px;
  padding:18px 20px;
  background:
    radial-gradient(circle at 15% 20%, rgba(79,70,229,0.08), transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(96,165,250,0.06), transparent 45%),
    linear-gradient(120deg, rgba(79,70,229,0.05), rgba(96,165,250,0.04) 55%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='1' stitchTiles='stitch'/></filter><rect width='60' height='60' filter='url(%23n)' opacity='0.04'/></svg>");
}
.incident-columns{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(360px,1fr));
  gap:22px;
}
.case-overview-card{
  grid-column:1 / -1;
  min-height:520px;
}
.nova-recap-head{
  padding-bottom:6px;
  border-bottom:1px solid var(--border);
  align-items:baseline;
}
.nova-recap-body{
  margin-top:10px;
  max-width:820px;
}
.nova-recap-output{
  margin-top:6px;
  padding:8px 12px;
  border-radius:12px;
  border:1px dashed var(--border);
  background:var(--card-glass);
  font-size:13px;
  line-height:1.4;
  max-width:720px;
  white-space:pre-line;
}
.nova-recap-output.clamped{
  display:-webkit-box;
  -webkit-line-clamp:4;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.nova-recap-toggle{
  margin-top:6px;
  align-self:flex-start;
  border:none;
  background:none;
  color:var(--primary);
  font-size:12px;
  font-weight:600;
  cursor:pointer;
}
.nova-recap-meta{
  margin-top:10px;
}
.nova-recap-skeleton{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:6px;
  max-width:720px;
}
.nova-recap-skeleton span{
  height:12px;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(226,232,240,0.4), rgba(148,163,184,0.4), rgba(226,232,240,0.4));
  background-size:200% 100%;
  animation:novaPulse 1.6s ease-in-out infinite;
}
.nova-recap-skeleton span:nth-child(1){width:92%}
.nova-recap-skeleton span:nth-child(2){width:80%}
.nova-recap-skeleton span:nth-child(3){width:64%}
.nova-recap-band[data-state="empty"] .nova-recap-meta{
  display:none;
}
.nova-recap-band[data-state="empty"] .nova-recap-output{
  padding:6px 10px;
}
.nova-recap-band[data-state="empty"] .nova-recap-body{
  margin-top:6px;
}
.nova-recap-band[data-state="empty"] .nova-recap-head{
  padding-bottom:4px;
  border-bottom:none;
}
.nova-recap-output.typing::after{
  content:'|';
  display:inline-block;
  margin-left:4px;
  animation:novaCaret 0.9s steps(1, end) infinite;
}
.nova-recap-output.pending{
  opacity:0.85;
}

/* Nova Docs */
.nova-docs-app{
  padding-top: 10px;
}
.nova-docs-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
}
.nova-docs-title{
  min-width:280px;
  font-size:18px;
  font-weight:700;
  border:1px solid var(--border);
  background:var(--card);
  border-radius:12px;
  padding:10px 12px;
  box-shadow:inset 0 1px 2px rgba(15,23,42,0.06);
}
.nova-docs-title:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(79,70,229,0.15);
}
.nova-docs-layout{
  display:grid;
  grid-template-columns:300px minmax(0,1fr);
  gap:14px;
}
.nova-docs-sidebar{
  max-height:calc(100vh - 170px);
  overflow:auto;
}
.nova-docs-sidebar input{
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  background:var(--card);
}
.nova-docs-editor{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}
.nova-docs-toolbar{
  position:sticky;
  top:0;
  z-index:3;
  backdrop-filter:blur(6px);
}
.nova-docs-canvas-wrap{
  background:linear-gradient(180deg,#eef2f7,#dde7f3);
  border:1px solid var(--border);
  border-radius:16px;
  padding:20px;
  min-height:calc(100vh - 250px);
}
.nova-docs-canvas{
  width:min(980px,100%);
  min-height:1100px;
  margin:0 auto;
  background:#fff;
  color:#111827;
  border-radius:8px;
  box-shadow:0 10px 24px rgba(15,23,42,0.14);
  padding:72px 84px;
  outline:none;
  font-size:16px;
  line-height:1.7;
  caret-color:#1d4ed8;
}
.nova-docs-canvas h1{font-size:2rem;line-height:1.2;margin:1.2rem 0 .6rem}
.nova-docs-canvas h2{font-size:1.5rem;line-height:1.3;margin:1.1rem 0 .55rem}
.nova-docs-canvas h3{font-size:1.2rem;line-height:1.35;margin:1rem 0 .5rem}
.nova-docs-canvas p{margin:.5rem 0}
.nova-docs-canvas ul,.nova-docs-canvas ol{padding-left:1.4rem}
.nova-docs-focus .app-nav{
  display:none;
}
.nova-docs-focus .app-main{
  margin-left:0;
}
.nova-docs-focus .nova-docs-sidebar{
  display:none;
}
.nova-docs-focus .nova-docs-layout{
  grid-template-columns:minmax(0,1fr);
}
.nova-docs-sidebar .task-card{
  width:100%;
  text-align:left;
}
@media (max-width: 1100px){
  .nova-docs-layout{grid-template-columns:1fr}
  .nova-docs-sidebar{max-height:none}
  .nova-docs-canvas{padding:40px 24px;min-height:70vh}
  .nova-docs-topbar{
    position:sticky;
    top:8px;
    z-index:4;
  }
}
@media print{
  .app-nav,.nova-docs-topbar,.nova-docs-sidebar,.nova-docs-toolbar{display:none !important}
  .nova-docs-canvas-wrap{border:none;background:#fff;padding:0}
  .nova-docs-canvas{box-shadow:none;margin:0;padding:0;min-height:auto}
}
.nova-recap-output.pending::after{
  content:'...';
  display:inline-block;
  width:0;
  overflow:hidden;
  vertical-align:bottom;
  margin-left:6px;
  animation:novaDots 1.1s steps(4, end) infinite;
}
.hidden{display:none !important}
.inline-check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text)}
.family-subtabs{margin:6px 0 12px;gap:10px}
.family-tabpane{display:block}
.family-tabpane.hidden{display:none}
#family_victim_select{min-width:220px}
.calendar-page{
  background:linear-gradient(180deg,rgba(124,136,255,0.15),rgba(255,255,255,0.9));
}
.calendar-page .calendar-shell{
  width:100%;
  max-width:1260px;
  margin:0 auto;
  padding:0 8px 20px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.calendar-page .cards{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.calendar-page .card{
  width:100%;
  max-width:none;
}
#event_card hr{
  border:none;
  border-top:1px solid var(--border);
  margin:16px 0;
}
#event_dates,
#event_time,
#event_location,
#event_notes,
#event_attendees{
  overflow-wrap:anywhere;
}
#edit_attendees_list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.settings-card .swatches{display:flex;gap:10px;flex-wrap:wrap;margin:6px 0 4px}
.settings-card .swatch{width:34px;height:34px;border-radius:10px;border:1px solid var(--border);box-shadow:inset 0 0 0 1px rgba(255,255,255,0.4);display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--text)}
.settings-note{background:var(--primary-soft);color:var(--text);padding:10px 12px;border-radius:12px;border:1px dashed var(--border);font-size:13px}

nav.tabs{
  display:flex;
  gap:12px;
  padding:18px 30px;
  width:calc(100% - 48px);
  max-width:1260px;
  margin:22px auto 0;
  background:linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,249,255,0.88));
  border-radius:var(--radius-lg);
  border:1px solid rgba(15,23,42,0.08);
  box-shadow:0 20px 46px rgba(31,41,55,0.1);
  overflow-x:auto;
  backdrop-filter:blur(18px);
}
body.dark-mode nav.tabs{background:rgba(5,8,20,0.85);border-color:rgba(255,255,255,0.08)}

.tab{
  border:1px solid transparent;
  background:rgba(14,116,214,0.1);
  color:var(--muted);
  padding:10px 22px;
  border-radius:999px;
  font-weight:600;
  font-size:14px;
  line-height:1.1;
  cursor:pointer;
  transition:all .2s ease;
  white-space:nowrap;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
  appearance:none;
  font-family:inherit;
}
.tab:hover{color:var(--primary);border-color:var(--primary-soft);background:rgba(14,116,214,0.16)}
.tab.active{background:var(--primary);color:#fff;box-shadow:0 12px 26px rgba(14,116,214,0.28)}

main{
  flex:1;
  padding:34px 28px;
  width:100%;
  max-width:1260px;
  margin:0 auto 70px;
}

.tabpane{display:none;animation:fade .25s ease}
.tabpane.active{display:block}
@keyframes fade{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}

.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:22px;
}

.dash-layout{
  display:flex;
  flex-direction:column;
  gap:20px;
}
.dash-summary{
  display:grid;
  grid-template-columns:repeat(3, minmax(200px, 1fr));
  gap:16px;
}
.dash-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  align-items:stretch;
}
/* quick notes now matches nova size */
@media (max-width: 1100px){
  .dash-summary{grid-template-columns:repeat(2, minmax(200px, 1fr));}
  .dash-row{grid-template-columns:1fr;}
}

.card{
  background:linear-gradient(180deg, var(--card-glass), var(--card));
  border-radius:var(--radius-lg);
  padding:24px;
  box-shadow:0 12px 28px rgba(15,23,42,0.1);
  border:1px solid var(--border);
  color:inherit;
  display:flex;
  flex-direction:column;
  gap:12px;
  position:relative;
  overflow:hidden;
  backdrop-filter:blur(20px);
}
.card.work-card,
.card.status-card{
  padding:22px;
}
.card.reference-card{
  padding:18px;
}
.card.reference-card h3{
  font-size:16px;
  font-weight:600;
}
.primary-action{
  align-self:flex-start;
  min-width:160px;
}
.activity-log{
  max-height:240px;
  overflow:auto;
}
.history-list{
  max-height:220px;
  overflow:auto;
  opacity:0.85;
}
.compact-empty{
  margin-top:6px;
}
.compact-empty .muted,
.compact-empty > .muted{
  margin:0;
}
.card::after{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(160deg,transparent 58%,rgba(14,116,214,0.06));
  pointer-events:none;
}
.card:hover{
  transform:translateY(-1px);
  box-shadow:0 16px 36px rgba(15,23,42,0.13);
}
.card h3{margin:0;font-size:18px;color:var(--primary);position:relative;z-index:1;font-family:'Space Grotesk', 'IBM Plex Sans', system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:-0.01em}
.card>*{position:relative;z-index:1}
.card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.card-head h3{margin:0}
.chart-legend{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  margin:2px 0 6px;
}
.legend-item{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:var(--muted);
}
.legend-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  display:inline-block;
}
.legend-dot.high{background:rgba(239,68,68,0.9)}
.legend-dot.medium{background:rgba(245,158,11,0.9)}
.legend-dot.low{background:rgba(59,130,246,0.9)}
#dash_chart_card h3{
  margin-bottom:2px;
}
#dash_chart_card p{
  margin:0;
}
#dash_chart_card .chart-legend{
  margin:2px 0 4px;
}
.quick-notes-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.quick-note{
  padding:12px;
  border-radius:var(--radius-md);
  border:1px solid var(--border);
  background:rgba(255,255,255,0.75);
  box-shadow:0 10px 24px rgba(15,23,42,0.08);
  display:flex;
  flex-direction:column;
  gap:8px;
}
body.dark-mode .quick-note{
  background:rgba(16,20,42,0.7);
  box-shadow:0 14px 30px rgba(0,0,0,0.35);
}
.quick-note-text{
  font-weight:600;
  line-height:1.45;
}
.quick-note-meta{
  font-size:12px;
  color:var(--muted);
}
.quick-note-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.quick-note-actions select{
  flex:1 1 200px;
  min-width:180px;
}
.quick-note-actions button{
  flex:0 0 auto;
}
.weather-forecast-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:8px;
}
.weather-day{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:rgba(255,255,255,0.72);
}
.weather-day-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.weather-desc{
  margin-top:3px;
  font-size:13px;
  color:var(--text);
}
.weather-temp{
  margin-top:4px;
  font-weight:700;
}
body.dark-mode .weather-day{
  background:rgba(14,18,36,0.72);
  border-color:rgba(255,255,255,0.1);
}

.subtle-divider{
  border:none;
  border-top:1px solid var(--border);
  margin:6px 0 2px;
}
.case-overview-grid{
  display:grid;
  grid-template-columns:160px 1fr;
  column-gap:14px;
  row-gap:8px;
}
.metric-meta.trend-up{
  color:#15803d;
  font-weight:700;
}
.metric-meta.trend-down{
  color:#b91c1c;
  font-weight:700;
}
.metric-meta.trend-neutral{
  color:var(--muted);
  font-weight:600;
}
.case-overview-label{
  font-size:12px;
  color:var(--muted);
  letter-spacing:.02em;
}
.case-overview-value{
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.case-overview-value a{
  color:var(--primary);
  text-decoration:none;
  border-bottom:1px dashed rgba(15, 23, 42, 0.3);
}
.case-overview-value a:hover{
  border-bottom-style:solid;
}
.is-admin-clickable{
  cursor:pointer;
  user-select:none;
}
.is-admin-clickable:hover{
  border-color:rgba(79,70,229,0.45);
  color:var(--primary);
}
body.dark-mode .is-admin-clickable:hover{
  border-color:rgba(129,140,248,0.6);
}
.station-link{
  color:var(--text);
  text-decoration:none;
}
.station-link:hover{
  color:var(--primary);
  text-decoration:underline;
}
.case-brief-details{
  max-width:640px;
  line-height:1.55;
}
.note-actions{
  align-items:center;
  flex-direction:row;
  gap:10px;
}
#case_note_save{
  width:100%;
}
#case_map_frame{
  height:190px;
}
.victim-page header{
  padding:19px 30px 16px;
}
.offender-page header{
  padding:19px 30px 16px;
}
.family-page header{
  padding:19px 30px 16px;
}
.family-overview-grid{
  display:grid;
  grid-template-columns:160px 1fr;
  column-gap:14px;
  row-gap:8px;
}
.family-overview-grid .stack{
  display:contents;
}
.family-label{
  font-size:12px;
  color:var(--muted);
  letter-spacing:.02em;
}
.family-value{
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.family-value:empty::before{
  content:'—';
  color:var(--muted);
  font-weight:500;
}
.family-address-row.address-empty{
  opacity:0.7;
}
.family-address-edit.address-empty{
  opacity:0.65;
}
.family-address-edit.collapsed{
  display:none;
}
.hvsg-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
}
.hvsg-group{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.hvsg-value.is-unknown{
  color:var(--muted);
  font-weight:500;
}
.groups-notes textarea{
  min-height:90px;
}
.relationship-columns{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:22px;
}
@media (max-width: 720px){
  .family-overview-grid{grid-template-columns:1fr}
  .family-value{white-space:normal}
}
.offender-meta-group{
  flex-wrap:wrap;
  justify-content:flex-end;
}
.linked-card .task-card{
  background:var(--card);
  border:1px solid var(--border);
}
.linked-card .task-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.linked-card .relationship-pill{
  font-size:12px;
  color:var(--muted);
}
.offender-page textarea{
  min-height:72px;
}
.is-unknown{
  color:var(--muted);
}
.compact-empty{
  margin-top:6px;
}
.primary-secondary{
  order:2;
}
.compact-card.is-empty{
  padding:18px;
}
.compact-card.is-empty .stack{
  margin-top:6px;
}
.empty-inline{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.incident-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:var(--radius-sm);
  border:1px solid var(--border);
  background:var(--card);
  text-decoration:none;
  color:inherit;
}
.incident-row .meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.incident-row .meta span{
  font-size:12px;
  color:var(--muted);
}

.map-embed{
  width:100%;
  height:220px;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.4);
}

.row{display:flex;gap:12px;align-items:center;margin-bottom:10px;flex-wrap:wrap}
.row.space-between{justify-content:space-between}
.row input,
.row select{
  flex:1 1 180px;
  padding:12px 14px;
  border-radius:var(--radius-md);
  border:1px solid var(--border);
  background:#fff;
  color:#0f172a;
}
body.dark-mode .row input,
body.dark-mode .row select{background:rgba(14,18,40,0.9);color:var(--text)}
.row button{
  background:var(--primary);
  color:#fff;
  border:none;
  padding:12px 18px;
  border-radius:var(--radius-md);
  cursor:pointer;
  font-weight:600;
  box-shadow:0 12px 24px rgba(79,70,229,0.28);
}
.row button:hover{background:var(--primary-dark)}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
  margin-bottom:12px;
}
.grid label,
.form-grid label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:13px;
  color:var(--muted);
  letter-spacing:.01em;
}
.grid input,
.grid select{
  padding:11px;
  border-radius:var(--radius-md);
  border:1px solid var(--border);
  color:var(--text);
  background:#fff;
}
body.dark-mode .grid input,
body.dark-mode .grid select{background:rgba(16,20,42,0.9)}
.form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
  margin-bottom:12px;
}
.form-grid input,
.form-grid select{
  padding:11px;
  border-radius:var(--radius-md);
  border:1px solid var(--border);
  color:var(--text);
  background:#fff;
}
.form-grid textarea{
  width:100%;
  padding:11px;
  border-radius:var(--radius-md);
  border:1px solid var(--border);
  color:var(--text);
  background:#fff;
  font:inherit;
  line-height:1.4;
  resize:vertical;
  min-height:78px;
}
body.dark-mode .form-grid input,
body.dark-mode .form-grid select{background:rgba(16,20,42,0.9)}
body.dark-mode .form-grid textarea{background:rgba(16,20,42,0.9)}
.form-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.form-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin-top:8px;
}
.form-actions.start{
  justify-content:flex-start;
}
.combo{position:relative;display:flex;align-items:center}
.combo input{width:100%;padding-right:44px}
.combo-toggle{
  position:absolute;
  right:6px;
  top:50%;
  transform:translateY(-50%);
  border:1px solid var(--border);
  background:#f8fafc;
  color:#0f172a;
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
  font-weight:700;
  line-height:1;
}
.combo-toggle:hover{background:#eef2f7}
.combo-list{
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  right:0;
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  box-shadow:0 18px 40px rgba(15,23,42,0.12);
  max-height:240px;
  overflow:auto;
  display:none;
  z-index:30;
}
.combo-item{
  width:100%;
  text-align:left;
  background:transparent;
  border:none;
  padding:10px 12px;
  cursor:pointer;
  color:#0f172a;
  font-size:13px;
}
.combo-item:hover{background:#f1f5f9}
body.dark-mode .combo-toggle{background:rgba(16,20,42,0.9);color:var(--text)}
body.dark-mode .combo-list{background:#0f172a;color:var(--text)}
body.dark-mode .combo-item{color:var(--text)}
body.dark-mode .combo-item:hover{background:rgba(148,163,184,0.16)}

.preset-row{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:12px}
.preset-row .presetIncident{
  flex:1;
  min-width:120px;
  background:var(--primary-soft);
  color:var(--primary);
  border:1px solid transparent;
  border-radius:12px;
  padding:9px 12px;
  font-weight:600;
  cursor:pointer;
}
.preset-row .presetIncident:hover{border-color:var(--primary);background:#fff}

.card textarea,
#tab-search textarea{
  width:100%;
  padding:13px;
  border-radius:var(--radius-md);
  border:1px solid var(--border);
  font-family:inherit;
  color:var(--text);
  background:#fff;
  resize:vertical;
  min-height:90px;
}
body.dark-mode textarea{background:rgba(16,20,42,0.9)}

.smartPaste{background-color:#f8f7ff}

.code{
  white-space:pre-wrap;
  background:var(--code-bg);
  color:var(--code);
  padding:13px;
  border-radius:var(--radius-md);
  min-height:56px;
  border:1px dashed rgba(15,23,42,0.18);
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 7px;
  margin-top:12px;
}
.table th{
  text-align:left;
  font-size:13px;
  font-weight:600;
  color:var(--muted);
  padding:6px 8px;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.table td{
  background:rgba(255,255,255,0.8);
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
  padding:12px 10px;
  font-size:14px;
}
body.dark-mode .table td{background:rgba(12,16,36,0.9)}
.table tbody tr:hover td{
  background:rgba(240,247,255,0.94);
}
body.dark-mode .table tbody tr:hover td{
  background:rgba(17,24,46,0.94);
}
.table tr td:first-child{border-left:1px solid var(--border);border-top-left-radius:12px;border-bottom-left-radius:12px}
.table tr td:last-child{border-right:1px solid var(--border);border-top-right-radius:12px;border-bottom-right-radius:12px}

.inc-table{border-collapse:collapse;width:100%;table-layout:auto;}
.inc-table th{font-size:12px;letter-spacing:0.05em;color:var(--muted);padding:12px 10px;border-bottom:1px solid var(--border);text-transform:uppercase;}
.inc-table td{background:rgba(255,255,255,0.95);border:1px solid var(--border);padding:12px 12px;vertical-align:top;}
body.dark-mode .inc-table td{background:rgba(10,15,36,0.85);}
.inc-table tbody tr:hover td{
  background:rgba(240,247,255,0.96);
}
body.dark-mode .inc-table tbody tr:hover td{
  background:rgba(15,24,46,0.9);
}
.inc-table .inc-cell{display:flex;flex-direction:column;gap:4px;}
.inc-table .inc-meta{font-size:12px;color:var(--muted);}
.inc-table .inc-details{
  line-height:1.5;
  max-width:100%;
  white-space:normal;
}
.inc-status-pill,.inc-sense-pill{display:inline-flex;align-items:center;padding:4px 10px;border-radius:10px;font-weight:600;font-size:12px;text-transform:capitalize;}
.inc-status-pill{background:rgba(79,70,229,0.1);color:var(--primary);}
.inc-sense-pill{background:rgba(16,185,129,0.12);color:#047857;}
.inc-actions{display:flex;flex-direction:column;gap:8px;align-items:center;min-width:80px;}
.inc-open{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 14px;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-weight:700;
  text-decoration:none;
  border:1px solid var(--border);
  min-width:64px;
}
.inc-open:hover{text-decoration:none;border-color:var(--primary);background:#fff;}
.inc-table .victim-count{font-weight:700;font-size:16px;text-align:center;min-width:40px;}

.list-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 8px;
  margin-top:12px;
}
.list-table th{
  text-align:left;
  font-size:11px;
  font-weight:700;
  color:var(--muted);
  padding:6px 10px;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.list-table td{
  background:var(--card);
  border:1px solid var(--border);
  padding:12px 12px;
  font-size:14px;
  vertical-align:top;
}
body.dark-mode .list-table td{background:rgba(12,16,36,0.9);}
.list-table tbody tr:hover td{
  background:rgba(240,247,255,0.96);
}
body.dark-mode .list-table tbody tr:hover td{
  background:rgba(17,24,46,0.94);
}
.list-table tr td:first-child{
  border-top-left-radius:12px;
  border-bottom-left-radius:12px;
}
.list-table tr td:last-child{
  border-top-right-radius:12px;
  border-bottom-right-radius:12px;
}
.list-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-start;
  min-width:90px;
}

.list-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--card);
}
.list-row .list-meta{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.list-row .list-actions{
  flex-direction:row;
  align-items:center;
  min-width:auto;
}

.pager{display:flex;gap:12px;align-items:center;margin-top:12px;font-weight:500}

.stack{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.stack.small{gap:6px;margin-top:8px}

.nova-convo-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:12px;
  gap:10px;
  font-size:13px;
  color:var(--muted);
}
.pill.tiny{padding:4px 12px;font-size:12px}
.nova-thread{
  display:flex;
  flex-direction:column;
  gap:10px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  margin-top:8px;
  background:linear-gradient(145deg, rgba(255,255,255,0.78), rgba(231,235,255,0.9));
  max-height:240px;
  overflow-y:auto;
  font-size:13px;
  position:relative;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.6);
  scroll-behavior:smooth;
}
/* NovaAI workspace page */
.nova-workspace-page .db-search{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.novaai-mode-bar{
  max-width:1100px;
  margin:0 auto 12px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.novaai-mode-bar .inline-check{
  font-size:12px;
}
.novaai-mode-bar .muted{
  font-size:11px;
}
.nova-workspace-page .db-search-label{
  font-size:12px;
  color:var(--muted);
  letter-spacing:.04em;
  text-transform:uppercase;
}
.nova-workspace-page .db-search-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(15,23,42,0.12);
  border-radius:12px;
  background:rgba(255,255,255,0.9);
  box-shadow:none;
}
.nova-workspace-page .db-search-row input{
  flex:1;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,0.12);
  background:transparent;
  font-size:15px;
  color:var(--text);
}
.nova-workspace-page #search_btn{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
  border-radius:12px;
}
.nova-workspace-page .search-results{
  margin:18px auto 0;
  max-width:1100px;
  width:100%;
  min-height:32px;
}
.nova-workspace-page .search-results .activity-item{
  padding:6px 0;
  border-bottom:1px solid var(--border);
}
.nova-workspace-page .search-results .activity-item:last-child{
  border-bottom:none;
}
.nova-workspace-page .nova-workspace{
  margin:20px auto 0;
  max-width:1100px;
  width:100%;
  border:1px solid rgba(15,23,42,0.06);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(248,250,252,0.96), rgba(248,250,252,0.9));
  box-shadow:0 10px 24px rgba(15,23,42,0.08);
  padding:18px 18px 14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  height:auto;
}
.nova-workspace-page .nova-workspace-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  padding:8px 6px;
  border-radius:12px;
  background:transparent;
}
.nova-workspace-page .nova-title{
  font-size:16px;
  font-weight:700;
}
.nova-workspace-page .nova-subtitle{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}
.nova-workspace-page .status-pill{
  display:inline-flex;
  align-items:center;
  font-size:11px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,0.08);
  color:var(--muted);
  background:rgba(148,163,184,0.12);
}
.nova-workspace-page .nova-workspace-divider{
  height:1px;
  background:rgba(15,23,42,0.06);
  margin:0;
}
.nova-workspace-page .nova-timeline{
  flex:1;
  overflow-y:auto;
  max-height:54vh;
  padding:2px 2px 6px;
  display:flex;
  flex-direction:column;
  gap:14px;
  background:transparent;
  border:none;
  border-radius:0;
  box-shadow:none;
  scrollbar-gutter:stable;
}
.nova-workspace-page .nova-turn{
  display:flex;
  flex-direction:column;
  max-width:72%;
  background:transparent;
  border:none;
  box-shadow:none;
  gap:4px;
  padding:0;
}
.nova-workspace-page .nova-turn.user{
  align-self:flex-end;
  text-align:right;
}
.nova-workspace-page .nova-turn.assistant{
  align-self:flex-start;
}
.nova-workspace-page .nova-turn .nova-bubble{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.06);
  background:rgba(255,255,255,0.9);
  line-height:1.55;
  box-shadow:none;
  word-break:break-word;
  white-space:pre-wrap;
  max-width:100%;
}
.nova-workspace-page .nova-turn.user .nova-bubble{
  border:1px solid rgba(15,23,42,0.08);
  background:rgba(236,242,247,0.9);
}
.nova-workspace-page .nova-turn.assistant .nova-bubble::before{
  content:'NovaAI';
  display:block;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--muted);
  margin-bottom:4px;
}
.nova-workspace-page .nova-time{
  font-size:10px;
  color:var(--muted);
  margin-top:4px;
}
.nova-workspace-page .nova-input-bar{
  padding-top:10px;
  border-top:1px solid rgba(15,23,42,0.06);
  background:transparent;
}
.nova-workspace-page .nova-input-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border:1px solid rgba(15,23,42,0.1);
  border-radius:12px;
  background:rgba(255,255,255,0.98);
  min-height:44px;
}
.nova-workspace-page .nova-input-wrap input{
  flex:1;
  border:none;
  background:transparent;
  font-size:14px;
  padding:6px 4px;
}
.nova-workspace-page .nova-input-wrap input:focus{
  outline:none;
}
.nova-workspace-page .nova-input-wrap:focus-within{
  border-color:rgba(71,85,105,0.35);
  box-shadow:0 0 0 3px rgba(148,163,184,0.25);
}
.nova-workspace-page .nova-input-wrap .pill{
  background:var(--primary);
  color:#fff;
  border:1px solid var(--primary);
  border-radius:12px;
  padding:8px 16px;
  transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.nova-workspace-page .nova-input-wrap .pill:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 18px rgba(15,23,42,0.12);
}
.nova-workspace-page .nova-input-wrap .pill:active{
  transform:translateY(0);
  box-shadow:none;
}
.nova-workspace-page .nova-input-wrap .pill:disabled{
  opacity:.6;
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}
body.dark-mode .nova-workspace-page .nova-input-wrap{
  background:rgba(12,16,32,0.95);
}

/* NovaAI full-page standalone */
.novaai-page{
  min-height:100vh;
  height:100vh;
  display:flex;
  flex-direction:column;
  font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:linear-gradient(180deg, rgba(246,248,252,1), rgba(232,237,247,0.96));
  background-image:
    radial-gradient(circle at 12% 8%, rgba(148,163,184,0.12), transparent 50%);
}
.novaai-page::before,
.novaai-page::after{
  opacity:0.08;
}
.novaai-shell{
  width:100%;
  flex:1;
  padding:76px 20px 120px;
  overflow:hidden;
  display:flex;
}
.novaai-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:64px;
  display:flex;
  align-items:center;
  border-bottom:1px solid rgba(15,23,42,0.1);
  background:rgba(246,248,252,0.96);
  backdrop-filter:blur(10px);
  z-index:20;
}
.novaai-header-inner{
  max-width:1100px;
  width:100%;
  margin:0 auto;
  padding:0 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.novaai-title{
  margin:0;
  font-size:20px;
  font-weight:700;
  letter-spacing:-0.02em;
}
.novaai-subtitle{
  margin:2px 0 0;
  color:var(--muted);
  font-size:11px;
  max-width:none;
}
.novaai-status{
  display:flex;
  align-items:center;
  gap:8px;
}
.novaai-status.inline{
  margin-top:0;
}
.novaai-status .dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#6366f1;
  box-shadow:0 0 0 3px rgba(16,185,129,0.18);
}
.novaai-thread{
  flex:1;
  max-width:1100px;
  width:100%;
  margin:0 auto;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:8px 0 12px;
  scrollbar-gutter:stable;
}
.novaai-thread .muted{
  color:var(--muted);
  font-size:13px;
}
.novaai-turn{
  display:flex;
  flex-direction:column;
  max-width:72%;
  gap:6px;
}
.novaai-turn.user{
  align-self:flex-end;
  text-align:right;
}
.novaai-turn.assistant{
  align-self:flex-start;
}
.novaai-bubble{
  padding:12px 14px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,0.12);
  background:rgba(255,255,255,0.92);
  line-height:1.55;
  white-space:pre-wrap;
  word-break:break-word;
}
.novaai-turn.user .novaai-bubble{
  background:rgba(230,236,244,0.9);
  border-color:rgba(15,23,42,0.16);
}
.novaai-bubble.pending{
  opacity:0.8;
}
.novaai-time{
  font-size:10px;
  color:var(--muted);
}
.novaai-input-bar{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  padding:10px 20px 14px;
  background:rgba(240,244,251,0.98);
  border-top:1px solid rgba(15,23,42,0.12);
  backdrop-filter:blur(10px);
  z-index:20;
}
.novaai-input-bar .row{
  max-width:1100px;
  margin:0 auto;
}
.novaai-input-bar .novaai-chips{
  max-width:1100px;
  margin:0 auto 8px;
}
.novaai-input-row{
  max-width:1100px;
  margin:0 auto 8px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(15,23,42,0.22);
  border-radius:8px;
  background:rgba(232,238,248,0.9);
  min-height:50px;
}
.novaai-input-row input{
  flex:1;
  border:none;
  background:transparent;
  font-size:14px;
  padding:8px 6px;
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}
.novaai-input-row input:focus{outline:none;}
.novaai-input-row:focus-within{
  border-color:rgba(37,99,235,0.5);
  box-shadow:0 0 0 3px rgba(59,130,246,0.22);
}
.novaai-input-row .pill{
  border-radius:6px;
  padding:8px 14px;
  font-weight:600;
  transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.novaai-input-row .pill:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 14px rgba(15,23,42,0.16);
}
.novaai-input-row .pill:disabled{
  opacity:.6;
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}
body.dark-mode .novaai-page{
  background:linear-gradient(180deg, rgba(8,12,24,0.98), rgba(12,16,32,0.95));
}
body.dark-mode .novaai-input-bar{
  background:rgba(10,14,28,0.96);
  border-top-color:rgba(255,255,255,0.08);
}
body.dark-mode .novaai-input-row{
  background:rgba(12,16,32,0.95);
  border-color:rgba(255,255,255,0.08);
}
body.dark-mode .novaai-bubble{
  background:rgba(255,255,255,0.04);
  border-color:rgba(255,255,255,0.08);
}
body.dark-mode .novaai-turn.user .novaai-bubble{
  background:rgba(16,185,129,0.14);
  border-color:rgba(16,185,129,0.22);
}
body.dark-mode .novaai-header{
  background:rgba(10,14,28,0.96);
  border-bottom-color:rgba(255,255,255,0.08);
}

.novaai-chips{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  overflow-x:auto;
  scrollbar-width:none;
}
.novaai-chips::-webkit-scrollbar{display:none;}
.novaai-chips .chip{
  border:1px solid rgba(15,23,42,0.18);
  background:rgba(234,240,248,0.9);
  color:var(--text);
  padding:6px 8px;
  border-radius:6px;
  font-size:11px;
  text-transform:none;
  cursor:pointer;
  transition:background .12s ease, border-color .12s ease;
}
.novaai-chips .chip:hover{
  background:rgba(79,70,229,0.1);
  border-color:rgba(79,70,229,0.32);
}
body.dark-mode .novaai-chips .chip{
  background:rgba(255,255,255,0.08);
  border-color:rgba(255,255,255,0.16);
  color:#e2e8f0;
}
body.dark-mode .novaai-chips .chip:hover{
  background:rgba(99,102,241,0.16);
  border-color:rgba(99,102,241,0.3);
}

/* Floating NovaAI button */
.nova-fab{
  position:fixed;
  right:22px;
  bottom:22px;
  width:52px;
  height:52px;
  border-radius:50%;
  border:1px solid rgba(15,23,42,0.12);
  background:rgba(255,255,255,0.9);
  color:var(--primary);
  font-size:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 12px 24px rgba(15,23,42,0.18);
  z-index:9999;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.nova-fab:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 28px rgba(15,23,42,0.2);
}
.nova-fab:active{
  transform:translateY(0);
  box-shadow:0 10px 20px rgba(15,23,42,0.16);
}
body.dark-mode .nova-fab{
  background:rgba(12,16,32,0.95);
  border-color:rgba(255,255,255,0.08);
  color:#e2e8f0;
}

/* NovaAI full-page mode */
body.novaai-mode{
  background:linear-gradient(180deg, rgba(248,250,252,1), rgba(241,245,249,0.9));
  background-image:none;
}
body.novaai-mode::before,
body.novaai-mode::after{
  opacity:0.2;
}
body.novaai-mode header{
  background:transparent;
  border:none;
  box-shadow:none;
  padding:22px 32px 8px;
}
body.novaai-mode header .status-row{
  align-items:flex-start;
}
body.novaai-mode header .status-row > :not(.headline-title){
  opacity:0.5;
}
body.novaai-mode #db_status{
  display:none;
}
body.novaai-mode nav.tabs{
  display:none;
}
body.novaai-mode main{
  flex:1;
}
body.novaai-mode #tab-search{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:12px 0 40px;
  min-height:calc(100vh - 140px);
}
body.novaai-mode .nova-workspace-page .db-search,
body.novaai-mode .nova-workspace-page .search-results{
  display:none;
}
body.novaai-mode .novaai-mode-bar{
  margin:0 auto;
  padding:6px 0;
}
body.novaai-mode .nova-workspace-page .nova-workspace{
  margin:0 auto;
  max-width:900px;
  width:100%;
  border:none;
  background:transparent;
  box-shadow:none;
  padding:0;
  gap:16px;
  flex:1;
  min-height:0;
}
body.novaai-mode .nova-workspace-page .nova-workspace-header{
  padding:0;
  background:transparent;
}
body.novaai-mode .nova-workspace-page .nova-workspace-divider{
  display:none;
}
body.novaai-mode .nova-workspace-page .nova-timeline{
  max-height:none;
  padding:4px 2px 10px;
  gap:16px;
  flex:1;
}
body.novaai-mode .nova-workspace-page .nova-input-bar{
  position:sticky;
  bottom:12px;
  padding:12px 0 6px;
  background:linear-gradient(180deg, rgba(248,250,252,0), rgba(248,250,252,0.9) 45%, rgba(248,250,252,0.98));
}
body.novaai-mode .nova-workspace-page .nova-input-wrap{
  border-radius:14px;
}
body.dark-mode.novaai-mode{
  background:linear-gradient(180deg, rgba(8,12,24,0.98), rgba(12,16,32,0.95));
}
body.dark-mode.novaai-mode .nova-workspace-page .nova-input-bar{
  background:linear-gradient(180deg, rgba(10,14,28,0), rgba(10,14,28,0.92) 45%, rgba(10,14,28,0.98));
}
body.dark-mode .nova-workspace-page .nova-timeline.nova-thread{
  background:transparent;
  border:none;
  box-shadow:none;
}
body.dark-mode .nova-workspace-page .db-search-row,
body.dark-mode .nova-workspace-page .db-search-row input,
body.dark-mode .nova-workspace-page .nova-workspace{
  background:linear-gradient(180deg, rgba(12,16,32,0.96), rgba(12,16,32,0.9));
}
body.dark-mode .nova-workspace-page .nova-input-wrap{
  background:rgba(12,16,32,0.95);
}
body.dark-mode .nova-thread{
  border-color:rgba(255,255,255,0.08);
  background:linear-gradient(150deg, rgba(16,20,42,0.88), rgba(12,16,32,0.92));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.04);
}
.nova-turn{
  padding:0;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.06);
  background:rgba(248,250,252,0.9);
  line-height:1.5;
  box-shadow:0 8px 18px rgba(15,23,42,0.06);
}
.nova-turn.user{
  align-self:flex-end;
  background:rgba(236,242,247,0.9);
  border-color:rgba(15,23,42,0.08);
}
.nova-turn.assistant{
  background:rgba(255,255,255,0.9);
  border-color:rgba(15,23,42,0.06);
}
.nova-turn.pending{
  opacity:0.85;
}
.nova-turn.pending .nova-thinking::after{
  content:'...';
  display:inline-block;
  width:0;
  overflow:hidden;
  vertical-align:bottom;
  margin-left:6px;
  animation:novaDots 1.1s steps(4, end) infinite;
}
body.dark-mode .nova-turn{
  border-color:rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.04);
  box-shadow:0 12px 24px rgba(0,0,0,0.35);
}
body.dark-mode .nova-turn.user{
  background:rgba(16,185,129,0.14);
  border-color:rgba(16,185,129,0.22);
}
body.dark-mode .nova-turn.assistant{
  background:rgba(124,58,237,0.12);
  border-color:rgba(124,58,237,0.2);
}
.nova-speaker{
  font-weight:600;
  display:block;
  margin-bottom:4px;
  color:var(--text);
}
.nova-time{
  display:block;
  font-size:11px;
  color:var(--muted);
  margin-top:4px;
}
body.dark-mode .nova-speaker{color:#e5e7eb;}
body.dark-mode .nova-time{color:#cbd5e1;}
.nova-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding-bottom:4px;
  border-bottom:1px solid rgba(15,23,42,0.1);
}
.nova-input-row{
  display:flex;
  gap:10px;
  margin-top:12px;
  align-items:center;
  justify-content:flex-start;
}
.nova-input-row.centered{
  justify-content:center;
}
.nova-input-row input{
  flex:1;
  min-width:0;
  background:linear-gradient(135deg,#fffdf6,#f4efe2);
  border:1px solid rgba(15,23,42,0.12);
  box-shadow:0 14px 28px rgba(79,86,121,0.12), inset 0 1px 0 rgba(255,255,255,0.9);
  font-weight:600;
  padding:14px 16px;
  border-radius:14px;
  max-width:720px;
}
body.dark-mode .nova-input-row input{
  background:linear-gradient(135deg,#0f172a,#111827);
  border-color:rgba(255,255,255,0.08);
  box-shadow:0 16px 34px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
  color:#e5e7eb;
}
.nova-input-row button{
  min-width:60px;
  width:60px;
  height:60px;
  background:linear-gradient(145deg,#4f46e5,#6366f1);
  color:#fff;
  border:none;
  box-shadow:0 18px 40px rgba(79,70,229,0.3);
  padding:0;
  border-radius:50%;
  font-weight:700;
}
.nova-input-row button:hover{transform:translateY(-1px);box-shadow:0 22px 44px rgba(79,70,229,0.4);}
.pill.compact{
  min-width:60px;
  padding:0;
  box-shadow:0 14px 28px rgba(79,70,229,0.22);
}
.audience-options{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-top:4px;
}
.recipient-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.recipient-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:12px;
  background:rgba(79,70,229,0.08);
  border:1px solid rgba(79,70,229,0.18);
  color:var(--text);
  font-size:12px;
}
.recipient-chip button{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:12px;
  color:var(--muted);
}
.recipient-chip button:hover{color:var(--text);}
body.dark-mode .recipient-chip{
  background:rgba(255,255,255,0.06);
  border-color:rgba(255,255,255,0.08);
  color:#e5e7eb;
}
.autocomplete-list{
  position:absolute;
  background:rgba(255,255,255,0.95);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:0 12px 24px rgba(15,23,42,0.15);
  max-height:220px;
  overflow:auto;
  z-index:10;
  width:100%;
}
.autocomplete-item{
  padding:8px 12px;
  cursor:pointer;
}
.autocomplete-item:hover{
  background:rgba(79,70,229,0.08);
}
body.dark-mode .autocomplete-list{
  background:rgba(15,17,35,0.95);
  border-color:rgba(255,255,255,0.08);
}
body.dark-mode .autocomplete-item:hover{
  background:rgba(255,255,255,0.08);
}
.search-icon{
  width:60px;
  min-width:60px;
  height:60px;
  padding:0;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  box-shadow:0 14px 28px rgba(79,70,229,0.25);
}
.nova-shortcuts{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
  justify-content:flex-start;
}
.nova-shortcuts.centered{
  justify-content:center;
}
.storage-meter{
  margin-top:6px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.storage-slider{
  width:100%;
  accent-color:#60a5fa;
}
.nova-file-input{
  display:none;
}
.nova-clip{
  border-radius:50%;
  width:40px;
  height:40px;
  min-width:40px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
}
.icon-btn{
  border:1px solid rgba(190,18,60,0.35);
  background:rgba(190,18,60,0.12);
  color:#be123c;
  border-radius:10px;
  padding:6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  cursor:pointer;
}
.icon-btn.neutral{
  border-color:rgba(148,163,184,0.35);
  background:rgba(148,163,184,0.12);
  color:var(--text);
}
.icon-btn.neutral:hover{
  border-color:rgba(59,130,246,0.35);
  background:rgba(59,130,246,0.12);
}
.icon-btn svg{
  width:14px;
  height:14px;
  fill:currentColor;
}
.nova-shortcuts .pill{
  border-radius:14px;
  padding:8px 14px;
  font-size:12px;
  background:rgba(79,70,229,0.08);
  border:1px solid rgba(79,70,229,0.18);
  color:var(--text);
  box-shadow:none;
}
body.dark-mode .nova-shortcuts .pill{
  background:rgba(255,255,255,0.06);
  border-color:rgba(255,255,255,0.08);
  color:#e5e7eb;
}
.nova-results{
  margin-top:16px;
  border:1px solid rgba(15,23,42,0.12);
  border-radius:20px;
  padding:18px;
  background:rgba(255,255,255,0.92);
  display:flex;
  flex-direction:column;
  gap:14px;
  max-height:320px;
  overflow:auto;
  box-shadow:0 20px 40px rgba(79,86,121,0.15);
}
body.dark-mode .nova-results{
  border-color:rgba(255,255,255,0.08);
  background:rgba(13,17,35,0.92);
  box-shadow:0 18px 36px rgba(0,0,0,0.4);
}
.nova-results-section{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.nova-results-section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:14px;
  font-weight:600;
}
.nova-results-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.nova-result-row{
  border:1px solid rgba(15,23,42,0.12);
  border-radius:14px;
  padding:12px 14px;
  background:rgba(255,255,255,0.95);
  box-shadow:0 12px 24px rgba(15,23,42,0.05);
}
body.dark-mode .nova-result-row{
  background:rgba(15,23,42,0.9);
}
.nova-result-row strong{
  font-size:13px;
  color:var(--text);
}
.nova-result-row .muted{
  font-size:11px;
  color:var(--muted);
}
.nova-result-row p{
  margin-top:6px;
  font-size:12px;
  color:var(--text);
}
.nova-results-empty{
  font-size:13px;
  color:var(--muted);
}
.nova-actions-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.nova-suggestions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.nova-matches{
  margin-top:12px;
  border:1px solid rgba(15,23,42,0.12);
  border-radius:14px;
  padding:12px;
  background:rgba(255,255,255,0.92);
  box-shadow:0 16px 32px rgba(15,23,42,0.08);
}
body.dark-mode .nova-matches{
  background:rgba(15,23,42,0.85);
  border-color:rgba(255,255,255,0.08);
  box-shadow:0 14px 28px rgba(0,0,0,0.35);
}
.nova-card{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(15,23,42,0.12);
  background:rgba(255,255,255,0.95);
  box-shadow:0 18px 40px rgba(79,86,121,0.2);
}
.nova-card::before,
.nova-card::after{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:0;
}
.nova-card::before{
  background:radial-gradient(circle at 20% 30%, rgba(79,70,229,0.18), transparent 50%),
             radial-gradient(circle at 80% 70%, rgba(96,165,250,0.14), transparent 40%);
  animation:none;
  filter:blur(6px);
}
.nova-card::after{
  background:linear-gradient(120deg, rgba(255,255,255,0.7), rgba(255,255,255,0));
  mix-blend-mode:screen;
  opacity:0.4;
  transform:translate(-60%,40%);
  animation:none;
}
.nova-card > *{
  position:relative;
  z-index:1;
}
@keyframes novaPulse{
  0%{transform:translate3d(-6px,-4px,0) scale(0.96) rotate(-1deg);opacity:0.45;}
  40%{transform:translate3d(4px,6px,0) scale(1.05) rotate(1deg);opacity:0.8;}
  70%{transform:translate3d(-2px,2px,0) scale(1.02) rotate(-0.5deg);opacity:0.62;}
  100%{transform:translate3d(6px,-5px,0) scale(0.98) rotate(1deg);opacity:0.5;}
}
@keyframes novaSweep{
  0%{transform:translate(-80%,60%) rotate(-1deg);opacity:0.22;}
  35%{transform:translate(-30%,20%) rotate(0deg);opacity:0.38;}
  70%{transform:translate(30%,-20%) rotate(1deg);opacity:0.32;}
  100%{transform:translate(80%,-60%) rotate(-1deg);opacity:0.22;}
}
@keyframes novaDots{
  0%{width:0}
  100%{width:16px}
}
@keyframes novaCaret{
  0%,100%{opacity:0}
  50%{opacity:1}
}
@media (max-width: 720px){
  .case-overview-grid{grid-template-columns:1fr}
  .case-overview-value{white-space:normal}
}
@media (max-width: 1020px){
  .app-shell{flex-direction:column;}
  .app-nav{
    width:100%;
    height:auto;
    position:relative;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:12px 10px;
    border-right:none;
    border-bottom:1px solid var(--border);
    overflow-x:auto;
  }
  .app-nav-footer{display:none;}
  .app-nav-head{display:none;}
  .app-nav-links{
    flex-direction:row;
    align-items:center;
    gap:8px;
    width:100%;
    flex-wrap:nowrap;
    overflow-x:auto;
    padding-bottom:2px;
  }
  .app-nav-links .tab{
    width:auto;
    flex:0 0 auto;
    white-space:nowrap;
    padding:8px 11px;
    font-size:12px;
  }
  .nav-section{
    margin:0 2px 0 0;
    padding:0;
    font-size:10px;
    white-space:nowrap;
  }
  .app-topbar{
    position:relative;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    width:calc(100% - 18px);
    padding:10px 12px;
    gap:10px;
    border-radius:16px;
  }
  .topbar-left,
  .topbar-right{
    flex:1 1 280px;
  }
  .topbar-search{
    order:3;
    flex:1 1 100%;
    max-width:none;
    width:100%;
  }
}
body.dark-mode .nova-card{
  border-color:rgba(255,255,255,0.08);
  background:rgba(18,23,45,0.94);
  box-shadow:0 22px 60px rgba(0,0,0,0.45);
}
body.dark-mode .nova-card::before{
  background:radial-gradient(circle at 20% 30%, rgba(99,102,241,0.16), transparent 50%),
             radial-gradient(circle at 78% 72%, rgba(96,165,250,0.12), transparent 40%);
  opacity:0.28;
  animation:none;
  transform:none;
}
body.dark-mode .nova-card::after{
  opacity:0;
  animation:none;
  transform:none;
  mix-blend-mode:screen;
}
.dark-mode .nova-recap-band{
  background:
    radial-gradient(circle at 15% 20%, rgba(99,102,241,0.16), transparent 55%),
    radial-gradient(circle at 85% 30%, rgba(96,165,250,0.12), transparent 50%),
    linear-gradient(120deg, rgba(99,102,241,0.1), rgba(96,165,250,0.08) 55%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='1' stitchTiles='stitch'/></filter><rect width='60' height='60' filter='url(%23n)' opacity='0.05'/></svg>");
}
.nova-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding-bottom:4px;
  border-bottom:1px solid rgba(15,23,42,0.1);
}
body.dark-mode .nova-card-head{
  border-color:rgba(255,255,255,0.08);
}
.nova-convo-head strong{
  font-size:14px;
  color:var(--primary-dark);
}
.nova-summary{
  display:none;
}
#dash_activity .pill{margin-right:auto}
.dash-metric{justify-content:center;text-align:left;gap:6px}
.dash-metric-status{
  background:
    radial-gradient(circle at 0% 0%, rgba(16,185,129,0.12), transparent 48%),
    linear-gradient(160deg, rgba(255,255,255,0.98), rgba(244,252,248,0.92));
}
.status-online-dot{
  width:9px;
  height:9px;
  border-radius:999px;
  background:#22c55e;
  box-shadow:0 0 0 6px rgba(34,197,94,0.18);
}
.trend-pill{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:2px 8px;
  font-size:11px;
  font-weight:700;
  color:#166534;
  background:rgba(34,197,94,0.16);
  border:1px solid rgba(34,197,94,0.36);
}
.operational-intel-card{
  background:
    radial-gradient(circle at 14% -8%, rgba(14,116,214,0.18), transparent 42%),
    radial-gradient(circle at 96% 12%, rgba(14,165,164,0.14), transparent 46%),
    linear-gradient(168deg, rgba(255,255,255,0.97), rgba(245,247,255,0.94));
}
.operational-intel-card .nova-input-row input{
  border-color:rgba(14,116,214,0.28);
  box-shadow:0 0 0 0 rgba(14,116,214,0);
  transition:border-color .3s ease, box-shadow .3s ease;
}
.operational-intel-card .nova-input-row input:focus{
  border-color:rgba(14,116,214,0.6);
  box-shadow:0 0 0 3px rgba(14,116,214,0.16);
}
.metric-label{font-size:13px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.metric-value{font-size:32px;font-weight:700;color:var(--text)}
.metric-meta{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
}
.metric-meta strong{
  color:var(--text);
  font-size:13px;
}
.metric-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:16px;
}
.metric-column{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.12);
  background:rgba(255,255,255,0.6);
}
.metric-column .metric-value{font-size:28px}
body.dark-mode .metric-column{
  background:rgba(17,23,52,0.75);
  border-color:rgba(255,255,255,0.15);
}
.total-stats-grid{
  grid-template-columns:repeat(2,minmax(120px,1fr));
  gap:12px;
}
.total-stats-card .metric-column{
  background:rgba(255,255,255,0.75);
}
body.dark-mode .total-stats-card .metric-column{
  background:rgba(13,16,40,0.85);
}
.chart-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  min-height:320px;
}
.chart-card h3{
  margin:0 0 8px;
}
.chart-card canvas{
  width:100% !important;
  max-width:520px;
  height:220px !important;
  margin:0 auto;
}
.chart-row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:18px;
  width:100%;
}
@media(max-width:1100px){
  .chart-row{grid-template-columns:1fr;}
}
.neo-chart{
  background:rgba(255,255,255,0.96);
  border:1px solid rgba(15,23,42,0.12);
  border-radius:20px;
  padding:12px 14px;
  box-shadow:0 24px 50px rgba(79,86,121,0.2);
  min-height:260px;
}
body.dark-mode .neo-chart{
  background:rgba(10,15,36,0.94);
  border-color:rgba(255,255,255,0.08);
  box-shadow:0 20px 44px rgba(0,0,0,0.5);
}
.glow-border{
  position:relative;
  overflow:hidden;
}
.glow-border::after{
  content:'';
  position:absolute;
  inset:-1px;
  border-radius:14px;
  background:radial-gradient(circle at 30% 30%, rgba(79,70,229,0.08), transparent 45%),
             radial-gradient(circle at 80% 60%, rgba(96,165,250,0.06), transparent 40%);
  pointer-events:none;
  z-index:0;
}
.glow-border > *{position:relative;z-index:1;}
.activity-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-radius:16px;
  background:rgba(34,197,94,0.12);
  color:#0f5132;
  border:1px solid rgba(34,197,94,0.25);
  font-weight:700;
  letter-spacing:0.01em;
}
.activity-chip.warn{
  background:rgba(250,204,21,0.16);
  border-color:rgba(250,204,21,0.4);
  color:#854d0e;
}
.activity-chip.error{
  background:rgba(239,68,68,0.15);
  border-color:rgba(239,68,68,0.35);
  color:#991b1b;
}
.pulse-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:12px;
  margin-top:12px;
}

.btn-danger{background:#fee2e2;color:#b91c1c;border:1px solid #fecaca;border-radius:10px;padding:7px 12px;cursor:pointer;font-size:12px;font-weight:600}
.btn-danger:hover{background:#fecaca}

.activity-item,
.contact-card,
.note-card,
.explore-card{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 14px;
  background:rgba(255,255,255,0.8);
  box-shadow:var(--shadow);
}
body.dark-mode .activity-item,
body.dark-mode .contact-card,
body.dark-mode .note-card,
body.dark-mode .explore-card{background:rgba(14,18,38,0.9)}
.activity-item h4,
.note-card h4,
.explore-card h4{margin:0 0 6px;color:var(--primary);font-size:16px}
.muted{color:var(--muted)}
.tiny{font-size:12px;line-height:1.3}
.good{color:var(--good)}
.bad{color:var(--bad)}

.search-page .search-card .row{
  flex-wrap:wrap;
}
.search-page #search_input{
  flex:1 1 320px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
}
body.dark-mode .search-page #search_input{
  background:rgba(14,18,40,0.9);
  color:var(--text);
}
.search-results{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.search-group{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.search-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.search-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--card);
}
.search-title{
  font-weight:600;
}

#insight_out{margin-top:10px}
#act_list,#contact_groups,#note_list,#contact_list,#search_results,#explore_list,#explore_detail{max-height:380px;overflow:auto}
#tab-search button,#tab-activities button,#tab-notes button,#tab-contacts button{margin-top:8px}

.family-directory{margin-top:10px}
.family-directory-table{width:100%}
.family-directory-table tbody tr.family-row{height:52px;cursor:pointer}
.family-directory-table tbody tr.family-row:hover{background:rgba(15,23,42,0.04)}
.family-directory-table tbody tr.family-row td{vertical-align:middle}
.family-directory-table tbody tr.family-row-detail td{padding:10px 12px}
.family-directory-table tbody tr.family-row-detail.hidden{display:none}
.family-detail-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:12px;align-items:center;max-height:120px}
.family-detail-row .truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:280px}

.dash-message-compose{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.quick-actions-card{
  background:
    radial-gradient(circle at 14% 0%, rgba(14,165,233,0.09), transparent 52%),
    radial-gradient(circle at 94% 16%, rgba(37,99,235,0.08), transparent 42%),
    linear-gradient(165deg, rgba(255,255,255,0.97), rgba(243,248,255,0.9));
}
.quick-actions-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.quick-action-tile{
  width:100%;
  border:1px solid rgba(14,116,214,0.2);
  border-radius:16px;
  padding:14px 14px;
  display:flex;
  align-items:center;
  gap:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.95), rgba(239,246,255,0.95));
  color:var(--text);
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
  text-align:left;
}
.quick-action-tile:hover{
  transform:translateY(-2px);
  border-color:rgba(37,99,235,0.4);
  background:linear-gradient(180deg, rgba(255,255,255,1), rgba(229,240,255,0.96));
  box-shadow:0 14px 28px rgba(15,23,42,0.14);
}
.quick-action-tile.disabled,
.quick-action-tile:disabled{
  opacity:0.55;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}
.qa-icon{
  width:36px;
  height:36px;
  border-radius:11px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  color:#0b4a86;
  background:linear-gradient(165deg, rgba(219,234,254,0.95), rgba(191,219,254,0.9));
  border:1px solid rgba(37,99,235,0.24);
  flex:0 0 auto;
}
.qa-copy{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.qa-copy strong{
  font-size:13px;
  line-height:1.1;
}
.qa-copy span{
  font-size:12px;
  color:var(--muted);
  line-height:1.25;
}
.quick-actions-foot{
  margin-top:2px;
  border-top:1px dashed rgba(14,116,214,0.24);
  padding-top:10px;
}
@media (max-width: 720px){
  .quick-actions-grid{
    grid-template-columns:1fr;
  }
}
#dash_message_input{
  width:100%;
  min-height:84px;
  resize:vertical;
  border-radius:14px;
  border:1px solid rgba(79,70,229,0.2);
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,247,255,0.92));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.85), 0 10px 20px rgba(15,23,42,0.08);
}
#dash_message_input:focus{
  border-color:rgba(79,70,229,0.45);
  box-shadow:0 0 0 3px rgba(79,70,229,0.14), 0 10px 20px rgba(15,23,42,0.1);
}
.dash-message-feed{
  margin-top:4px;
  max-height:360px;
  overflow:auto;
  padding-right:4px;
}
.dash-message-more{
  align-self:flex-start;
}
#dash_message_board,
#dash_nova_card{
  height:100%;
}
#dash_message_feed .message{
  border-radius:14px;
  padding:12px 13px;
  background:linear-gradient(180deg, rgba(255,255,255,0.95), rgba(247,250,255,0.9));
  box-shadow:0 10px 22px rgba(15,23,42,0.1);
}
.message-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom:8px;
  gap:12px;
}
.message-author-wrap{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.message-author{
  font-weight:700;
  line-height:1.2;
}
.message-time{
  font-size:12px;
}
.message-actions{
  flex:0 0 auto;
}
#dash_message_feed .message-body{
  margin:0;
  color:var(--text);
  line-height:1.5;
  white-space:normal;
  word-break:break-word;
}
.message-empty{
  border:1px dashed var(--border);
  border-radius:12px;
  padding:12px;
  background:rgba(255,255,255,0.6);
}
.message-log{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  background:rgba(255,255,255,0.85);
  margin-bottom:10px;
}
body.dark-mode .message-log{
  background:rgba(13,17,35,0.9);
  border-color:rgba(255,255,255,0.08);
}
.recipient-chips .muted{margin:0}
.autocomplete-list.hidden{display:none}
body.dark-mode #dash_message_input{
  background:linear-gradient(180deg, rgba(13,17,35,0.95), rgba(12,16,30,0.92));
  border-color:rgba(129,140,248,0.3);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.05), 0 12px 24px rgba(0,0,0,0.35);
}
body.dark-mode #dash_message_input:focus{
  border-color:rgba(129,140,248,0.55);
  box-shadow:0 0 0 3px rgba(129,140,248,0.2), 0 12px 24px rgba(0,0,0,0.42);
}
body.dark-mode #dash_message_feed .message{
  background:linear-gradient(180deg, rgba(14,18,36,0.92), rgba(11,14,28,0.9));
  box-shadow:0 14px 26px rgba(0,0,0,0.34);
}
body.dark-mode .message-empty{
  background:rgba(14,18,36,0.7);
  border-color:rgba(255,255,255,0.12);
}
body.dark-mode .quick-actions-card{
  background:
    radial-gradient(circle at 10% -5%, rgba(14,165,233,0.14), transparent 48%),
    radial-gradient(circle at 92% 12%, rgba(37,99,235,0.16), transparent 44%),
    linear-gradient(170deg, rgba(13,18,34,0.96), rgba(10,14,28,0.94));
}
body.dark-mode .dash-metric-status{
  background:
    radial-gradient(circle at 0% 0%, rgba(34,197,94,0.2), transparent 46%),
    linear-gradient(160deg, rgba(14,18,36,0.92), rgba(10,14,28,0.94));
}
body.dark-mode .trend-pill{
  color:#86efac;
  background:rgba(34,197,94,0.16);
  border-color:rgba(34,197,94,0.4);
}
body.dark-mode .operational-intel-card{
  background:
    radial-gradient(circle at 12% -10%, rgba(126,198,255,0.24), transparent 44%),
    radial-gradient(circle at 94% 14%, rgba(52,211,153,0.18), transparent 48%),
    linear-gradient(165deg, rgba(12,16,32,0.94), rgba(8,12,24,0.96));
}
body.dark-mode .quick-action-tile{
  border-color:rgba(96,165,250,0.32);
  background:linear-gradient(180deg, rgba(14,23,44,0.95), rgba(9,16,32,0.96));
  color:#e5e7eb;
}
body.dark-mode .quick-action-tile:hover{
  border-color:rgba(125,211,252,0.6);
  background:linear-gradient(180deg, rgba(18,29,54,0.95), rgba(11,18,36,0.96));
  box-shadow:0 18px 32px rgba(0,0,0,0.4);
}
body.dark-mode .qa-icon{
  color:#dbeafe;
  border-color:rgba(125,211,252,0.42);
  background:linear-gradient(180deg, rgba(30,58,138,0.7), rgba(29,78,216,0.42));
}
body.dark-mode .quick-actions-foot{
  border-top-color:rgba(125,211,252,0.35);
}

@media (prefers-reduced-motion: no-preference){
  .dash-layout > .dash-summary .card,
  .dash-layout > .dash-row > .card{
    animation:cardRise .36s ease both;
  }
  .dash-layout > .dash-row > .card:nth-child(2){
    animation-delay:.05s;
  }
}

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

.card select{padding:11px;border-radius:14px;border:1px solid var(--border);background:#fff}
body.dark-mode .card select{background:rgba(16,20,42,0.9)}
.card input[type="file"]{
  padding:10px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
}
body.dark-mode .card input[type="file"]{background:rgba(16,20,42,0.9);color:var(--text)}

.status-panels{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:18px;
  margin-top:18px;
}
.history-item{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:var(--card-glass);
}
.history-item h5{
  margin:0 0 4px;
  font-size:14px;
}
.history-item .history-meta{
  font-size:12px;
  color:var(--muted);
}
.task-card{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 14px;
  background:var(--card-glass);
}
.task-card.done{opacity:0.65}
.task-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  font-weight:600;
}
.task-meta{
  font-size:13px;
  color:var(--muted);
}
.task-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.task-actions button{
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;
  cursor:pointer;
}
.task-actions button:hover{
  border-color:var(--primary);
  color:var(--primary);
}
.calendar-strip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:6px 4px 2px;
  flex-wrap:wrap;
}
.calendar-nav{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.calendar-nav .month-label{
  font-size:22px;
  font-weight:600;
  letter-spacing:-0.02em;
  color:var(--text);
}
.calendar-strip-tools{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.calendar-ical-links{
  display:flex;
  align-items:center;
  gap:6px;
}
.strip-field{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:var(--muted);
}
.strip-field.secondary{
  opacity:0.75;
}
.strip-field select,
.strip-field input{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
  font-size:12px;
}
.calendar-view-toggles{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.calendar-view-toggles.secondary{
  opacity:0.7;
}
.toggle-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:3px 8px;
  border-radius:12px;
  border:1px solid var(--border);
  font-size:11px;
  color:var(--muted);
  background:transparent;
  cursor:pointer;
}
.toggle-chip input{
  margin:0;
}
.calendar-main{
  border:1px solid var(--border);
  border-radius:14px;
  padding:6px 6px 10px;
  background:var(--card);
  box-shadow:none;
  margin-top:2px;
  overflow-x:auto;
  min-height:520px;
  position:relative;
}
.calendar-legend{
  margin-top:8px;
  padding:0 6px;
}
.calendar-weekdays{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  text-align:center;
  color:var(--muted);
  font-weight:600;
  margin-bottom:4px;
  gap:4px;
  min-width:980px;
}
.calendar-weekdays .weekday{
  padding:5px 4px;
  border-radius:8px;
  background:rgba(79,70,229,0.04);
}
.mini-card{
  margin-top:8px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card-glass);
  box-shadow:var(--shadow);
  padding:10px 12px;
}
.upcoming-card{
  box-shadow:none;
  padding:10px 12px;
}
.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,minmax(140px,1fr));
  grid-auto-rows:minmax(160px,1fr);
  gap:1px;
  margin-top:6px;
  min-width:980px;
  background:var(--border);
  padding:1px;
  border-radius:10px;
}
.calendar-day{
  border:1px solid transparent;
  border-radius:8px;
  padding:6px;
  background:var(--card);
  min-height:120px;
  display:flex;
  flex-direction:column;
  gap:6px;
  position:relative;
}
.calendar-day.outside{
  opacity:0.5;
}
.calendar-day.today{
  border-color:var(--primary);
  background:var(--primary-soft);
}
.calendar-day h5{
  margin:0;
  font-size:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  color:var(--muted);
}
.calendar-day .calendar-weather{
  font-size:11px;
  color:var(--text);
  background:rgba(15, 118, 110, 0.08);
  border:1px solid rgba(15, 118, 110, 0.16);
  padding:2px 6px;
  border-radius:999px;
  align-self:flex-start;
  display:inline-flex;
  align-items:center;
  gap:4px;
}
.calendar-day.outside .calendar-weather{
  opacity:0.7;
}
.calendar-day .calendar-weather .wx-label{
  text-transform:capitalize;
}
.calendar-day.today h5{
  color:var(--text);
  font-weight:700;
}
.calendar-chip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  padding:3px 6px;
  border-radius:6px;
  border:1px solid transparent;
  background:transparent;
  font-size:12px;
  line-height:1.1;
  min-width:0;
}
.calendar-chip .chip-title{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.calendar-chip .chip-badge{
  font-size:9px;
  color:var(--muted);
  padding:0;
  border:none;
  text-transform:uppercase;
  letter-spacing:0.04em;
}
.calendar-chip.event .chip-badge{color:#0b3b71;border-color:rgba(14,116,144,0.3)}
.calendar-chip.holiday .chip-badge{color:#854d0e;border-color:rgba(202,138,4,0.25)}
body.dark-mode .calendar-chip{background:transparent}
.event-chip{color:#0b3b71;border-color:rgba(14,116,144,0.3);background:rgba(14,116,144,0.1)}
.holiday-chip{color:#854d0e;border-color:rgba(202,138,4,0.25);background:rgba(202,138,4,0.12)}

.calendar-recap-panel{
  position:absolute;
  top:8px;
  right:8px;
  width:min(360px, 90vw);
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--card);
  box-shadow:none;
  padding:10px 12px;
  z-index:2;
}
.calendar-recap-panel .nova-recap-output{
  margin-top:6px;
  max-width:100%;
}
.calendar-upcoming-item{
  padding:6px 0;
  border-bottom:1px solid var(--border);
}
.calendar-upcoming-item:last-child{
  border-bottom:none;
}
.calendar-upcoming-item .upcoming-title{
  font-size:13px;
  font-weight:600;
}
.mini-card h4{font-size:15px}

.calendar-recap{
  padding:12px 14px;
  margin-top:6px;
}
.calendar-recap h3{
  font-size:16px;
}
.calendar-recap .nova-recap{
  margin-top:0;
}
.calendar-recap .nova-recap-output{
  max-width:720px;
}

#event_admin_panel{
  margin-top:8px;
  padding:14px;
}
#event_admin_panel h3{
  font-size:16px;
}
#event_admin_panel p{
  margin:4px 0 0;
  font-size:12px;
}

#toast{
  position:fixed;
  right:20px;
  bottom:20px;
  background:var(--text);
  color:#fff;
  padding:12px 16px;
  border-radius:14px;
  opacity:0;
  transform:translateY(10px);
  transition:.25s;
  box-shadow:0 10px 25px rgba(0,0,0,0.2);
}
#toast.show{opacity:1;transform:translateY(0)}

.progress-bar{
  height:6px;
  border-radius:999px;
  background:rgba(148,163,184,0.25);
  overflow:hidden;
  margin-top:8px;
}
.progress-fill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, var(--primary), #22d3ee);
  transition:width .3s ease;
}
.progress-bar.hidden{display:none}

.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:60;
}
.modal.hidden{display:none}
.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(4, 12, 18, 0.55);
}
.modal-card{
  position:relative;
  width:min(520px, 92vw);
  background:#0f1a22;
  border:1px solid rgba(148, 163, 184, 0.25);
  border-radius:16px;
  padding:12px 14px;
  box-shadow:0 20px 40px rgba(2, 6, 12, 0.5);
}
.modal-card .input{
  width:100%;
}
.modal-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.modal-item{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(15, 23, 42, 0.6);
  border:1px solid rgba(148, 163, 184, 0.15);
}
.modal-item strong{display:block}
.modal-meta{font-size:11px;color:#94a3b8}

footer{
  text-align:center;
  padding:22px;
  color:var(--muted);
  font-size:13px;
  border-top:1px solid var(--border);
  display:flex;
  flex-direction:column;
  gap:10px;
  background:rgba(255,255,255,0.4);
}
body.dark-mode footer{background:rgba(5,8,20,0.75)}

.dark-mode .card{color:var(--text)}
.dark-mode .admin-panel{background:var(--card);color:var(--text)}
.dark-mode .message{background:var(--card);border-color:var(--border);color:var(--text)}
.admin-panel{
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  background:var(--card);
  color:var(--text);
  box-shadow:var(--shadow);
}
.admin-panel.hidden{display:none}
.admin-panel h4{margin:0 0 8px;color:var(--primary)}
.admin-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px}
.admin-grid input,.admin-grid select{padding:10px;border-radius:12px;border:1px solid var(--border)}
.admin-grid button{padding:11px;border:none;border-radius:12px;background:var(--primary);color:#fff;font-weight:600;cursor:pointer}
.admin-table{margin-top:12px;width:100%}
.admin-table td select{width:100%;padding:6px;border-radius:8px;border:1px solid var(--border)}
.admin-table input{width:100%;padding:6px;border-radius:8px;border:1px solid var(--border)}
.admin-panel-grid{display:grid;grid-template-columns:340px 1fr;gap:18px;align-items:start;}
.admin-table-wrap{overflow:auto;max-height:420px;border:1px solid var(--border);border-radius:14px;background:rgba(255,255,255,0.7);}
body.dark-mode .admin-table-wrap{background:rgba(10,15,36,0.8);}
.admin-panel button{align-self:flex-start;}
.admin-actions{display:flex;gap:6px}
.admin-form h4{color:var(--primary)}
.admin-form .grid label .row{margin-bottom:0}
.admin-form .grid label .row input{flex:1 1 auto}
.admin-table .userEmail,
.admin-table .userPhone,
.admin-table .userDisplay,
.admin-table .userTeam{min-width:160px}
.admin-table .userPassword{min-width:170px}
.admin-table .admin-actions{flex-wrap:wrap}
.admin-table .userPasswordMeta{min-height:16px}

/* Responsive */
@media(max-width:1080px){
  header{width:calc(100% - 36px);padding:22px 24px;margin-top:24px}
  nav.tabs{width:calc(100% - 36px);margin:18px auto 0}
  .headline{grid-template-columns:1fr 1fr;align-items:flex-start;gap:10px}
  .status-row h1{font-size:30px}
  main{padding:26px 20px}
  .card{padding:20px}
}
@media(max-width:880px){
  header{width:calc(100% - 18px);padding:18px 16px;margin-top:18px}
  .headline{grid-template-columns:1fr;text-align:left}
  .headline-title{align-items:flex-start}
  .status-row{flex-direction:column;align-items:flex-start;gap:10px}
  .status-group{justify-content:flex-start}
  .status-row h1{font-size:26px}
  nav.tabs{
    position:sticky;
    top:10px;
    z-index:20;
    padding:10px 12px;
    border-radius:16px;
    width:calc(100% - 18px);
    margin:12px auto 0;
    box-shadow:0 14px 32px rgba(15,23,42,0.16);
  }
  .tab{padding:9px 16px;font-size:13px}
  main{padding:20px 14px;margin-bottom:50px}
  .cards{grid-template-columns:1fr}
  .card{border-radius:14px;overflow-x:auto}
  .row{flex-direction:column;align-items:stretch}
  .row input,
  .row select,
  .row button{width:100%}
  .grid{grid-template-columns:1fr}
  .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .total-stats-grid{grid-template-columns:1fr 1fr}
  .nova-input-row{flex-direction:column;align-items:stretch}
  .nova-input-row button{
    width:100%;
    min-width:0;
    height:52px;
    border-radius:12px;
  }
  .nova-input-row input{width:100%}
  .nova-thread{max-height:320px}
  .pill{padding:8px 14px}
  .pill.tiny{padding:6px 12px;font-size:11px}
  .pill.compact,
  .search-icon{width:52px;min-width:52px;height:52px}
  .nova-card-head,
  .nova-convo-head{flex-direction:column;align-items:flex-start}
  .calendar-page .calendar-shell{padding:0 6px 22px}
  .calendar-strip,
  .calendar-strip-tools{flex-direction:column;align-items:flex-start}
  .calendar-weekdays,
  .calendar-grid{min-width:820px}
  .calendar-day{min-height:120px}
  .calendar-recap-panel{
    position:static;
    width:100%;
    margin-top:8px;
  }
  .table,
  .inc-table,
  .list-table{
    display:block;
    width:100%;
    overflow-x:auto;
  }
  .table th,
  .table td,
  .inc-table th,
  .inc-table td,
  .list-table th,
  .list-table td{
    white-space:nowrap;
  }
}
@media(max-width:640px){
  body::before,body::after{display:none}
  header{margin-top:14px}
  .status-row h1{font-size:24px}
  .pill{font-size:12px}
  nav.tabs{padding:10px 12px}
  main{padding:18px 12px}
  .metric-grid,
  .total-stats-grid{grid-template-columns:1fr}
  .card table,
  .table,
  .inc-table,
  .list-table{display:block;width:100%;overflow-x:auto}
  .inc-table th,
  .inc-table td,
  .list-table th,
  .list-table td,
  .table th,
  .table td{white-space:nowrap;font-size:12px}
  .calendar-weekdays,
  .calendar-grid{min-width:720px}
}
@media(max-width:480px){
  nav.tabs{top:6px}
  header{padding:16px 14px}
  .status-row h1{font-size:22px}
  .pill{padding:7px 12px}
  .search-icon,
  .pill.compact{height:48px;min-width:48px;width:48px}
  .nova-shortcuts{gap:6px}
}
