/* -------------------------------------------------------------
   Tailwind UI Catalyst Inspired Design System - Mission Control
   Brand: Raging Rocket | Palette: Pure Monochrome Dark Zinc

   NOTE FOR DEVELOPERS & AI AGENTS:
   Whenever UI tokens, colors, components, or styles in this file
   are updated or added, update REPORT_UI_STYLE_PROMPT in both
   app.js and api.js to keep the Report UI Style Prompt synchronized!
   ------------------------------------------------------------- */

:root {
  --bg-app: #09090b;
  --bg-sidebar: #0e0e11;
  --bg-surface: #121215;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;
  --bg-card-active: #27272a;
  --bg-input: #09090b;
  
  --border-subtle: #27272a;
  --border-medium: #3f3f46;
  --border-highlight: rgba(255, 255, 255, 0.15);
  
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-dim: #52525b;

  --btn-primary-bg: #fafafa;
  --btn-primary-text: #09090b;
  --btn-primary-hover: #e4e4e7;

  --btn-secondary-bg: #18181b;
  --btn-secondary-text: #fafafa;
  --btn-secondary-hover: #27272a;
  
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  
  --sidebar-width: 240px;
  --topbar-height: 52px;
  
  --shadow-subtle: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-dropdown: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

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

/* =============================================================
   CUSTOM SCROLLBARS & BROWSER NORMALIZATION
   Cross-platform dark zinc themed scrollbars (no default OS bars)
   ============================================================= */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.32);
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

::selection {
  background-color: rgba(99, 102, 241, 0.35);
  color: #ffffff;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-size: 0.875rem; /* Standardized 14px */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* -------------------------------------------------------------
   LOGIN SCREEN (Pure Minimalist, Just Google Sign In)
   ------------------------------------------------------------- */
.login-screen {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-app);
  padding: 1.5rem;
}

.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.btn-google-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background-color: #fafafa;
  color: #09090b;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-subtle);
}

.btn-google-login:hover {
  background-color: #e4e4e7;
  transform: translateY(-0.5px);
}

.btn-google-login svg {
  color: #09090b;
}

.error-banner {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 0.8125rem;
  text-align: center;
  line-height: 1.4;
  max-width: 380px;
}

.error-banner code {
  color: #ffffff;
  font-weight: 600;
}

/* -------------------------------------------------------------
   APP LAYOUT & SIDEBAR
   ------------------------------------------------------------- */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: var(--bg-app);
  overflow-x: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.brand-text {
  white-space: nowrap;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--text-primary);
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  font-weight: 600;
}

.nav-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  color: var(--text-primary);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
}

.sidebar-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  z-index: 45;
}

/* -------------------------------------------------------------
   MAIN SHELL & TOPBAR
   ------------------------------------------------------------- */
.main-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-app);
}

.app-topbar {
  height: var(--topbar-height);
  background-color: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* -------------------------------------------------------------
   BUTTONS (Monochrome)
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-decoration: none;
  font-family: inherit;
}

.btn-icon-only {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-md);
}

#copyReportStylePromptBtn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

#copyReportStylePromptBtn.copied {
  border-color: rgba(52, 211, 153, 0.4);
  background-color: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
}

.btn-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background-color: var(--btn-secondary-hover);
  border-color: var(--border-medium);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-danger-ghost {
  background-color: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-danger-ghost:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
  border-color: #ef4444;
}

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

.btn-sm {
  padding: 0.32rem 0.65rem;
  font-size: 0.75rem;
  gap: 0.35rem;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 0.22rem 0.5rem;
  font-size: 0.7rem;
  gap: 0.3rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* -------------------------------------------------------------
   LANDING DASHBOARD VIEW (Just Menu Buttons)
   ------------------------------------------------------------- */
.landing-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
  flex: 1;
}

.landing-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.landing-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
  cursor: pointer;
}

.landing-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.landing-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

.landing-card-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

.landing-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.landing-card-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

/* -------------------------------------------------------------
   REPORTS SYSTEM VIEW
   ------------------------------------------------------------- */
.reports-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
  flex: 1;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem 0.45rem 2.25rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--border-medium);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.report-count-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Reports Table Card */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.reports-table th {
  padding: 0.7rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(255, 255, 255, 0.02);
}

.reports-table td {
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

/* Folder Rows */
.folder-row {
  background-color: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.15s ease;
}

.folder-row.drag-over {
  background-color: rgba(255, 255, 255, 0.06) !important;
  outline: 1px dashed #fafafa;
}

.folder-row td {
  padding: 0.55rem 1.25rem;
}

.folder-row-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.folder-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.folder-chevron-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease, color 0.15s ease;
}

.folder-chevron-btn:hover {
  color: var(--text-primary);
}

.folder-chevron-btn.collapsed svg {
  transform: rotate(-90deg);
}

.folder-icon {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.folder-name-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.folder-name-text:hover {
  text-decoration: underline;
}

.folder-count-pill {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
}

.folder-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.folder-empty-row td {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 1.25rem;
  background-color: rgba(0, 0, 0, 0.15);
  font-style: italic;
}

.folder-empty-row.drag-over {
  background-color: rgba(255, 255, 255, 0.06) !important;
  outline: 1px dashed #fafafa;
}

/* Unfiled Section */
.unfiled-row td {
  padding: 0.55rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
}

.unfiled-row.drag-over {
  background-color: rgba(255, 255, 255, 0.06) !important;
  outline: 1px dashed #fafafa;
}

.unfiled-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Report Rows */
.report-row {
  transition: background-color 0.1s ease;
  cursor: grab;
}

.report-row:active {
  cursor: grabbing;
}

.report-row:hover {
  background-color: var(--bg-card-hover);
}

.report-row.dragging {
  opacity: 0.35;
}

.report-row-in-folder td:first-child {
  padding-left: 2.5rem;
}

.report-title-cell {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.drag-handle {
  color: var(--text-dim);
  cursor: grab;
  display: flex;
  align-items: center;
  opacity: 0.6;
}

.drag-handle:hover {
  opacity: 1;
  color: var(--text-secondary);
}

.report-link-title {
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.report-link-title:hover {
  text-decoration: underline;
}

.report-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.report-size {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.report-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.report-actions-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Empty State Card */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
}

.empty-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.empty-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* -------------------------------------------------------------
   PUBLIC REPORT VIEWER
   ------------------------------------------------------------- */
.viewer-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg-app);
  overflow: hidden;
}

.viewer-topbar {
  height: var(--topbar-height);
  background-color: rgba(9, 9, 11, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 30;
  flex-shrink: 0;
}

.viewer-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  max-width: 50%;
}

.viewer-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.viewer-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.notes-count-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background-color: var(--border-medium);
  color: var(--text-primary);
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.viewer-frame-wrapper {
  flex: 1;
  width: 100%;
  height: calc(100vh - var(--topbar-height));
  background-color: #ffffff;
  position: relative;
}

.report-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* -------------------------------------------------------------
   DISCUSSION NOTES DRAWER
   ------------------------------------------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.notes-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 90vw;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  z-index: 65;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-modal);
}

.drawer-backdrop.active .notes-drawer {
  transform: translateX(0);
}

.notes-drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card);
}

.notes-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notes-drawer-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notes-pill-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.notes-feed {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notes-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.notes-empty-state svg {
  margin-bottom: 0.75rem;
  color: var(--text-dim);
}

.notes-empty-state p {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.notes-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 240px;
}

.note-bubble {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.note-author-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.note-author-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.note-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.note-content {
  font-size: 0.8125rem;
  color: #e4e4e7;
  line-height: 1.5;
  word-break: break-word;
}

.note-content p { margin-bottom: 0.5rem; }
.note-content h3 { font-size: 0.875rem; font-weight: 600; margin: 0.5rem 0 0.25rem; color: #ffffff; }
.note-content ul, .note-content ol { padding-left: 1.25rem; margin-bottom: 0.5rem; }
.note-content blockquote {
  border-left: 2px solid var(--border-medium);
  padding-left: 0.75rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
  font-style: italic;
}
.note-content a { color: #ffffff; text-decoration: underline; }

.note-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.notes-compose-wrap {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
}

.notes-compose-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.note-admin-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Rich Text Toolbar */
.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.toolbar-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  font-family: inherit;
}

.toolbar-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.toolbar-separator {
  width: 1px;
  height: 12px;
  background-color: var(--border-subtle);
  margin: 0 0.15rem;
}

.note-editor {
  min-height: 70px;
  max-height: 140px;
  overflow-y: auto;
  background-color: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.5;
  outline: none;
}

.note-editor:focus {
  border-color: var(--border-medium);
}

.note-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  pointer-events: none;
}

.notes-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.note-editor-hint {
  font-size: 0.6875rem;
  color: var(--text-dim);
}

/* -------------------------------------------------------------
   MODALS (Monochrome)
   ------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-dialog-manifest {
  max-width: 720px;
  width: 95vw;
}

.modal-dialog-sm {
  max-width: 440px;
  width: 94vw;
}

.modal-header {
  padding: 1.25rem 1.5rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background-color: rgba(24, 24, 27, 0.85);
}

.modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.modal-description {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-body-manifest {
  padding: 1.5rem 1.75rem 2rem 1.75rem;
  max-height: 72vh;
  overflow-y: auto;
  gap: 1rem;
}

.modal-section-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a1a1aa;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: normal;
}

.input-text, .input-select {
  width: 100%;
  background-color: #0c0c0e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.58rem 0.8rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: all 0.15s ease;
}

.input-text:focus, .input-select:focus {
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.35);
  background-color: #101015;
}

.input-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.input-select option {
  background-color: #18181b;
  color: #f4f4f5;
}

.textarea-html {
  width: 100%;
  height: 200px;
  background-color: #0c0c0e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
  font-size: 0.8125rem;
  color: #e4e4e7;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  resize: vertical;
  line-height: 1.45;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: all 0.15s ease;
}

.textarea-html:focus {
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.35);
  background-color: #101015;
}

.modal-footer {
  padding: 0.95rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(14, 14, 17, 0.75);
  backdrop-filter: blur(8px);
}

.modal-footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =============================================================
   CUSTOM APP DIALOG (Replaces confirm, prompt, alert)
   ============================================================= */
.dialog-body {
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.dialog-icon-badge {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-icon-badge.danger {
  background-color: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.dialog-icon-badge.info {
  background-color: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.dialog-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dialog-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fafafa;
  margin: 0;
  line-height: 1.3;
}

.dialog-message {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  white-space: pre-line;
}

.dialog-prompt-wrapper {
  margin-top: 0.5rem;
}

.dialog-footer {
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
}

/* Spinner */
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  background-color: rgba(24, 24, 27, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fafafa;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 380px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-success {
  border-left: 3px solid #10b981;
}

.toast-error {
  border-left: 3px solid #ef4444;
}

.toast-info {
  border-left: 3px solid #6366f1;
}

/* -------------------------------------------------------------
   MANIFEST OPERATIONAL DATABASE VIEW
   ------------------------------------------------------------- */
.manifest-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  width: 100%;
  flex: 1;
}

/* Compact Single-Row Metrics Ribbon (Zero-Fluff) */
.manifest-metrics-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-subtle);
  width: 100%;
}

.manifest-metric-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.manifest-metric-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.manifest-metric-val {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', 'Inter', monospace;
  letter-spacing: -0.01em;
}

.manifest-metric-val.highlight {
  color: #34d399;
}

.manifest-metric-divider {
  width: 1px;
  height: 14px;
  background-color: var(--border-subtle);
}

/* Filter Chips */
.manifest-filter-chips {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-chip {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.filter-chip.active {
  background-color: var(--bg-card-hover);
  color: #fafafa;
  border-color: var(--border-highlight);
}

.filter-chip-divider {
  width: 1px;
  height: 18px;
  background-color: var(--border-subtle);
  margin: 0 0.25rem;
}

.filter-chip.filter-chip-archive {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #71717a;
}

.filter-chip.filter-chip-archive:hover {
  color: #a1a1aa;
  border-color: rgba(255, 255, 255, 0.15);
}

.filter-chip.filter-chip-archive.active {
  background-color: rgba(113, 113, 122, 0.15);
  color: #d4d4d8;
  border-color: rgba(113, 113, 122, 0.35);
}

.archive-count-pill {
  font-size: 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.05rem 0.35rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
  line-height: 1.2;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  line-height: 1.4;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.status-pill.status-retainer {
  background-color: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.status-pill.status-retainer::before {
  background-color: #10b981;
}

.status-pill.status-active {
  background-color: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.status-pill.status-active::before {
  background-color: #38bdf8;
}

.status-pill.status-lead {
  background-color: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.status-pill.status-lead::before {
  background-color: #f59e0b;
}

.status-pill.status-internal {
  background-color: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}
.status-pill.status-internal::before {
  background-color: #a855f7;
}

.status-pill.status-archived {
  background-color: rgba(113, 113, 122, 0.1);
  color: #a1a1aa;
  border: 1px solid rgba(113, 113, 122, 0.25);
}
.status-pill.status-archived::before {
  background-color: #71717a;
}

/* Manifest Table Rows & Compact High-Density Grid */
.manifest-table {
  table-layout: fixed;
  width: 100%;
}

.manifest-table th {
  padding: 0.5rem 0.85rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(255, 255, 255, 0.02);
}

.manifest-table td {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.manifest-table tr.manifest-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
  height: 48px;
}

.manifest-table tr.manifest-row:hover {
  background-color: rgba(255, 255, 255, 0.035);
}

.manifest-cell-2col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
  overflow: hidden;
}

.manifest-entity-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.manifest-domain-link {
  font-size: 0.71875rem;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
  transition: color 0.15s ease;
}

.manifest-domain-link:hover {
  color: #fafafa;
  text-decoration: underline;
}

.manifest-domain-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manifest-host-val {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.manifest-stack-tags {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.08rem 0.35rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  margin: 0;
}

.tech-tag.tech-tag-count {
  opacity: 0.7;
  padding: 0.08rem 0.3rem;
  background-color: rgba(255, 255, 255, 0.04);
}

.manifest-retainer-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #34d399;
  line-height: 1.25;
}

.manifest-retainer-period {
  font-size: 0.65rem;
  font-weight: normal;
  color: var(--text-muted);
  margin-left: 1px;
}

.manifest-renewal-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
}

.manifest-non-retainer {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.manifest-contact-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.manifest-contact-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
  transition: color 0.15s ease;
}

.manifest-contact-sub:hover {
  color: #fafafa;
  text-decoration: underline;
}

.manifest-contact-email-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manifest-sub-text {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.manifest-action-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.manifest-action-btns .btn-icon-only {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.manifest-action-btns .btn-icon-only:hover {
  color: #fafafa;
  background-color: rgba(255, 255, 255, 0.08);
}

.manifest-action-btns .btn-danger-ghost:hover {
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.12);
}

/* Cross-System Pill on Reports */
.report-manifest-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.report-manifest-tag:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fafafa;
  border-color: var(--border-medium);
}

/* -------------------------------------------------------------
   MANIFEST INSPECTOR DRAWER (Slide-Over)
   ------------------------------------------------------------- */
.manifest-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 540px;
  max-width: 95vw;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  z-index: 65;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-modal);
}

.drawer-backdrop.active .manifest-drawer {
  transform: translateX(0);
}

.manifest-drawer-header {
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background-color: var(--bg-card);
}

.manifest-drawer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.manifest-drawer-kicker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.manifest-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 8px #6366f1;
}

.manifest-drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.manifest-drawer-title-row {
  width: 100%;
}

.manifest-drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.3;
  word-break: break-word;
}

.manifest-drawer-meta-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.drawer-status-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.drawer-status-select {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.28rem 1.6rem 0.28rem 0.75rem;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  background-position: right 0.55rem center;
  background-repeat: no-repeat;
  background-size: 10px 10px;
}

.drawer-status-select.status-retainer {
  background-color: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.drawer-status-select.status-active {
  background-color: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.drawer-status-select.status-lead {
  background-color: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.drawer-status-select.status-internal {
  background-color: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23c084fc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.drawer-status-select.status-archived {
  background-color: rgba(113, 113, 122, 0.14);
  color: #a1a1aa;
  border: 1px solid rgba(113, 113, 122, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.drawer-status-select:hover {
  filter: brightness(1.15);
}

.drawer-status-select:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.drawer-status-select option {
  background-color: #18181b;
  color: #f4f4f5;
  font-weight: 500;
}

.manifest-domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.manifest-domain-badge:hover {
  color: #fafafa;
}

.manifest-drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.manifest-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.manifest-link-pill-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.manifest-link-pill-sm:hover {
  background-color: rgba(255, 255, 255, 0.09);
  color: #fafafa;
  border-color: var(--border-medium);
}

.manifest-section-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
}

.manifest-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.manifest-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.85rem;
}

.manifest-profile-cell {
  min-width: 0;
}

.manifest-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.manifest-field-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.manifest-field-val {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.manifest-field-val.highlight {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: #34d399;
}

.manifest-field-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.manifest-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.manifest-tags-wrap .tech-tag {
  max-width: none;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
}

.manifest-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.manifest-contact-info {
  min-width: 0;
}

.manifest-contact-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.manifest-contact-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.25;
  margin-top: 0.1rem;
}

.manifest-contact-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.manifest-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.manifest-contact-link:hover {
  color: #fafafa;
  border-color: var(--border-medium);
}

.manifest-vault-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.manifest-vault-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.manifest-vault-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.manifest-vault-ref {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
}

.manifest-reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.manifest-report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
}

.manifest-report-item-title {
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}

.manifest-report-item-title:hover {
  color: #fafafa;
  text-decoration: underline;
}

.manifest-empty-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.manifest-notes-box {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  font-family: inherit;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.modal-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-additional-contact-card {
  background-color: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease;
}

.modal-additional-contact-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.modal-additional-contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-additional-contact-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   ------------------------------------------------------------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .sidebar-backdrop.mobile-open {
    display: block;
  }
  
  .mobile-menu-btn {
    display: inline-flex;
  }

  .manifest-metrics-row {
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
  }
}

@media (max-width: 640px) {
  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input-wrap {
    max-width: 100%;
  }
  
  .reports-table th:nth-child(2),
  .reports-table td:nth-child(2),
  .reports-table th:nth-child(3),
  .reports-table td:nth-child(3) {
    display: none;
  }

  .manifest-table th:nth-child(3),
  .manifest-table td:nth-child(3),
  .manifest-table th:nth-child(4),
  .manifest-table td:nth-child(4),
  .manifest-table th:nth-child(5),
  .manifest-table td:nth-child(5) {
    display: none;
  }
  
  .notes-drawer,
  .manifest-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .manifest-metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    padding: 0.6rem 0.85rem;
  }

  .manifest-metric-divider {
    display: none;
  }

  .modal-form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* =============================================================
   ARRAY TEMPLATES & DEMO ENGINE DASHBOARD VIEW
   ============================================================= */
.array-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  width: 100%;
  flex: 1;
}

.array-table th:first-child,
.array-table td:first-child {
  padding-left: 1.25rem;
}

.template-cell-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.template-emblem {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #27272a 0%, #18181b 100%);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-primary);
}

.template-emblem.emblem-dining {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(154, 52, 18, 0.3) 100%);
  border-color: rgba(249, 115, 22, 0.4);
  color: #f97316;
}

.template-info-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.template-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.template-name-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
}

.template-name-link:hover {
  text-decoration: underline;
  color: #fafafa;
}

.template-sub-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.template-slug-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.template-sections-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.template-section-pill {
  font-size: 0.6875rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}

.template-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  white-space: nowrap;
}

.template-status-pill .status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #34d399;
}

.template-actions-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

/* Personalizer Output Box */
.personalizer-output-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1.25rem;
}

.personalizer-url-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #38bdf8;
  word-break: break-all;
  background: #09090b;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin: 0.5rem 0 0.85rem;
  display: block;
}

@media (max-width: 640px) {
  .array-table th:nth-child(3),
  .array-table td:nth-child(3),
  .array-table th:nth-child(4),
  .array-table td:nth-child(4) {
    display: none;
  }
}

