:root {
  --bg: #f5f8fd;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #dbe7f6;
  --primary: #1554a6;
  --primary-dark: #0b3674;
  --primary-soft: #eaf3ff;
  --sidebar: #0b2f5b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, Helvetica, sans-serif; background: linear-gradient(135deg, #f5f8fd 0%, #eef5fc 46%, #f9fbff 100%); color: var(--text); display: flex; min-height: 100vh; }
.sidebar { width: 280px; background: var(--sidebar); color: white; padding: 22px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: grid; gap: 12px; align-items: center; }
.brand-logo { width: 210px; max-width: 100%; height: auto; background: white; border-radius: 8px; padding: 8px; display: block; }
h1 { font-size: 19px; margin: 0; }
.brand p { margin: 2px 0 0; color: #cbd5e1; font-size: 12px; }
nav { display: grid; gap: 8px; }
.nav-btn, .sidebar-footer button, .import-label { text-align: left; border: 0; padding: 11px 12px; border-radius: 8px; background: transparent; color: #dbeafe; cursor: pointer; font-size: 14px; }
.nav-btn.active, .nav-btn:hover, .sidebar-footer button:hover, .import-label:hover { background: rgba(255,255,255,0.12); }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; }
.import-label input { display: none; }
main { flex: 1; padding: 28px; overflow: auto; background-image: linear-gradient(rgba(21, 84, 166, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(21, 84, 166, 0.045) 1px, transparent 1px); background-size: 34px 34px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
h2 { margin: 0; font-size: 28px; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.data-mode { font-size: 12px; font-weight: 700; }
.data-mode.shared { color: var(--primary); }
.data-mode.local { color: #92400e; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.topbar-actions input { min-width: 280px; }
.primary { background: var(--primary); color: white; border: 0; border-radius: 8px; padding: 11px 16px; cursor: pointer; font-weight: 700; }
.primary:hover { background: var(--primary-dark); }
.section { display: none; }
.section.active { display: block; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card, .panel { background: rgba(255,255,255,0.94); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05); }
.card { border: 1.5px solid #9fc3ee; border-left: 5px solid var(--primary); padding: 20px; box-shadow: 0 10px 26px rgba(21, 84, 166, 0.09); }
.card span { color: var(--muted); font-size: 14px; }
.card strong { display: block; font-size: 34px; margin-top: 10px; }
.panel { padding: 20px; margin-bottom: 20px; }
.panel h3 { margin-top: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-heading h3 { margin: 0; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.project-card { border: 1.5px solid #9fc3ee; border-left: 5px solid var(--primary); border-radius: 8px; padding: 14px; background: #fbfcfe; display: grid; gap: 10px; box-shadow: 0 10px 26px rgba(21, 84, 166, 0.09); }
.project-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-card h4 { margin: 0; font-size: 16px; line-height: 1.3; }
.project-meta { color: var(--muted); font-size: 13px; display: grid; gap: 3px; }
.project-filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.project-filter-bar select { min-width: 170px; }
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.project-board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 4px; }
.project-board-column { border: 1px solid var(--line); border-radius: 8px; background: #f7fbff; min-width: 240px; display: grid; gap: 12px; padding: 12px; }
.project-board-column > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid #dbe7f6; }
.project-board-column h4 { margin: 0; color: var(--primary-dark); font-size: 14px; }
.project-board-column > header span { min-width: 26px; height: 26px; border-radius: 999px; background: white; color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; border: 1px solid #b9d4f5; }
.project-board-cards { display: grid; gap: 12px; }
.project-row { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fbfcfe; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(170px, auto) auto; gap: 16px; align-items: center; }
.project-row h4 { margin: 0 0 6px; font-size: 16px; }
.project-latest { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.project-portfolio-card { border: 1.5px solid #9fc3ee; border-left: 5px solid var(--primary); border-radius: 8px; background: #ffffff; padding: 14px; display: grid; gap: 12px; box-shadow: 0 10px 26px rgba(21, 84, 166, 0.09); }
.project-portfolio-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.project-portfolio-card h4 { margin: 0; color: var(--primary-dark); font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.project-portfolio-card header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.project-snapshot { display: grid; grid-template-columns: 1fr; gap: 8px; }
.project-snapshot span { border: 1px solid #dbe7f6; border-radius: 8px; background: white; padding: 9px; color: #374151; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.project-snapshot strong { display: block; color: var(--primary); font-size: 11px; text-transform: uppercase; margin-bottom: 4px; }
.project-owner-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-chip { border: 1px solid #b9d4f5; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); padding: 4px 8px; font-size: 11px; font-weight: 800; }
.mini-chip.muted { border-color: var(--line); background: #f8fafc; color: var(--muted); }
.health-pill { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-style: normal; font-weight: 800; }
.health-pill.good { background: #dcfce7; color: #166534; }
.health-pill.attention { background: #fee2e2; color: #991b1b; }
.health-pill.paused { background: #fef3c7; color: #92400e; }
.project-progress-block { display: grid; gap: 8px; }
.project-progress-block > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.project-progress-block strong { color: var(--primary-dark); }
.project-card-note { border-left: 3px solid #b9d4f5; padding-left: 10px; }
.project-card-note strong { display: block; margin-bottom: 5px; color: #374151; font-size: 13px; }
.project-card-note p { margin: 0; color: #4b5563; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.project-card-actions { border-top: 1px solid var(--line); padding-top: 10px; display: flex; justify-content: flex-end; }
.test-updates-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.test-updates-total { border: 1px solid #b9d4f5; border-radius: 999px; background: var(--primary-soft); color: var(--primary); padding: 7px 11px; font-size: 12px; white-space: nowrap; }
.test-updates-timeline { display: grid; gap: 18px; }
.experiment-date-nav { position: sticky; top: 0; z-index: 2; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.96); padding: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; box-shadow: 0 5px 16px rgba(15,23,42,.08); }
.experiment-date-nav > span { color: #374151; font-size: 12px; font-weight: 900; }
.experiment-date-nav a { border: 1px solid var(--date-accent); border-radius: 999px; background: var(--date-soft); color: var(--date-accent); padding: 5px 9px; font-size: 11px; font-weight: 800; text-decoration: none; }
.experiment-date-nav a:hover { color: white; background: var(--date-accent); }
.test-date-group { scroll-margin-top: 72px; border: 2px solid var(--date-accent); border-radius: 10px; background: color-mix(in srgb, var(--date-soft) 35%, white); overflow: hidden; }
.test-date-header { padding: 13px 15px; background: var(--date-soft); border-bottom: 2px solid var(--date-accent); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.test-date-header span { display: block; color: var(--date-accent); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.test-date-header h4 { margin: 0; color: var(--date-dark); font-size: 17px; }
.test-date-header > strong { color: var(--muted); font-size: 12px; }
.shootout-table-wrap { margin: 14px; border: 1px solid var(--project-accent); border-radius: 8px; background: white; overflow-x: auto; }
.shootout-table { min-width: 1110px; table-layout: fixed; }
.shootout-table th { background: var(--project-soft); color: var(--project-accent); border-bottom: 2px solid var(--project-accent); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.shootout-table th:nth-child(1) { width: 160px; }
.shootout-table th:nth-child(2) { width: 170px; }
.shootout-table th:nth-child(3), .shootout-table th:nth-child(4), .shootout-table th:nth-child(5), .shootout-table th:nth-child(6) { width: 190px; }
.shootout-table tbody tr:nth-child(even) { background: #f8faff; }
.shootout-table tbody tr:hover { background: var(--project-soft); }
.shootout-table td { overflow-wrap: anywhere; }
.shootout-project-cell { border-left: 5px solid var(--project-accent); }
.shootout-project-cell .project-status { margin-top: 8px; }
.shootout-owner-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.experiment-project-name { display: block; border-radius: 6px; background: var(--project-soft); color: var(--project-accent); padding: 6px 8px; font-size: 13px; }
.shootout-table .detail-list { padding-left: 16px; font-size: 12px; }
.shootout-table .empty-state { font-size: 12px; }
.project-dialog-summary { margin-bottom: 16px; display: grid; gap: 12px; }
.project-dialog-hero { border: 1px solid #b9d4f5; border-radius: 8px; background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%); padding: 14px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.project-dialog-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-dialog-title-row h4 { margin: 0; color: var(--primary-dark); font-size: 20px; }
.project-dialog-hero p { margin: 6px 0 10px; color: var(--muted); font-size: 13px; }
.project-dialog-side { display: grid; gap: 10px; align-self: start; }
.project-dialog-metrics { display: grid; grid-template-columns: repeat(2, minmax(90px, 1fr)); gap: 8px; min-width: 0; }
.project-dialog-metrics span { border: 1px solid #dbe7f6; border-radius: 8px; background: white; padding: 9px; color: var(--muted); font-size: 12px; }
.project-dialog-metrics strong { display: block; color: var(--primary-dark); font-size: 15px; margin-bottom: 3px; }
.project-dialog-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.project-dialog-insights section { border-left: 3px solid #b9d4f5; background: #fbfcfe; padding: 9px 10px; border-radius: 0 8px 8px 0; }
.project-dialog-insights h5 { margin: 0 0 5px; font-size: 12px; color: #374151; }
.project-dialog-insights p { margin: 0; color: #4b5563; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.demo-card { border: 1.5px solid #9fc3ee; border-left: 5px solid var(--primary); border-radius: 8px; background: #fbfcfe; padding: 16px; display: grid; gap: 14px; box-shadow: 0 10px 26px rgba(21, 84, 166, 0.09); }
.demo-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.demo-card h4 { margin: 0; font-size: 17px; color: var(--primary-dark); line-height: 1.3; overflow-wrap: anywhere; }
.demo-card header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.demo-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.demo-meta span { border: 1px solid #dbe7f6; border-radius: 8px; background: white; padding: 9px; color: #374151; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.demo-meta strong { display: block; color: var(--primary); font-size: 11px; text-transform: uppercase; margin-bottom: 4px; }
.demo-checklist-card { border: 1px solid #dbe7f6; border-radius: 8px; background: white; padding: 10px; display: grid; gap: 8px; }
.demo-checklist-card h5 { margin: 0; color: #374151; font-size: 13px; font-weight: 800; }
.checklist-summary { display: flex; flex-wrap: wrap; gap: 7px; }
.checklist-summary span { border: 1px solid var(--line); border-radius: 999px; background: #f8fafc; color: var(--muted); padding: 5px 8px; font-size: 12px; font-weight: 700; }
.checklist-summary span.checked { border-color: #b9d4f5; background: var(--primary-soft); color: var(--primary-dark); }
.demo-detail-preview { border: 1px solid #dbe7f6; border-radius: 8px; background: white; padding: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-detail-preview strong { display: block; color: var(--primary); font-size: 12px; text-transform: uppercase; margin-bottom: 3px; }
.demo-detail-preview span { color: #4b5563; font-size: 13px; }
.demo-notes { display: grid; gap: 10px; }
.demo-notes section { border-left: 3px solid #b9d4f5; padding-left: 10px; }
.demo-notes h5 { margin: 0 0 5px; color: #374151; font-size: 13px; font-weight: 800; }
.demo-notes p { margin: 0; color: #4b5563; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.demo-actions { border-top: 1px solid var(--line); padding-top: 10px; display: flex; justify-content: flex-end; gap: 10px; }
.test-history-section { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: white; display: grid; gap: 10px; margin-bottom: 16px; }
.test-history-section h4 { margin: 0; font-size: 14px; color: var(--primary-dark); }
.collapsible-section { transition: border-color .15s ease, box-shadow .15s ease; }
.collapsible-section.collapsed { gap: 0; }
.collapsible-section.collapsed .collapsible-content { display: none; }
.collapsible-trigger { width: 100%; border: 0; background: transparent; color: var(--primary-dark); padding: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; text-align: left; font: inherit; }
.collapsible-trigger span { font-size: 15px; font-weight: 900; }
.collapsible-trigger strong { border: 1px solid #b9d4f5; border-radius: 999px; background: var(--primary-soft); color: var(--primary); min-width: 34px; min-height: 26px; padding: 4px 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.collapsible-section:not(.collapsed) .collapsible-trigger { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 4px; }
.collapsible-content { display: grid; gap: 12px; }
.test-history { display: grid; gap: 10px; max-height: 28vh; overflow: auto; }
.test-update { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfcfe; display: grid; gap: 8px; }
.test-update header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-test-row { border: 1px solid #c8dcf4; border-radius: 8px; padding: 10px 12px; background: #f7fbff; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.field-test-link { border: 0; background: transparent; color: var(--primary); cursor: pointer; font: inherit; font-weight: 800; padding: 0; text-align: left; }
.field-test-link:hover { text-decoration: underline; }
.details-dialog { display: grid; gap: 14px; }
.test-details-content { display: grid; gap: 14px; }
.test-details-content .field { display: grid; gap: 6px; }
.test-detail { display: grid; gap: 6px; }
.test-detail h5 { margin: 0; font-size: 13px; color: #374151; font-weight: 800; }
.test-detail p { margin: 0; color: #4b5563; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-list { margin: 0; padding-left: 20px; color: #4b5563; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.detail-list li + li { margin-top: 4px; }
.demo-details-dialog textarea { min-height: 120px; }
.add-test-panel { border: 1px solid #b9d4f5; border-radius: 8px; background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%); display: grid; gap: 14px; padding: 14px; box-shadow: 0 10px 24px rgba(21, 84, 166, 0.08); }
.add-test-panel header { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.add-test-panel.collapsed header { border-bottom: 0; padding-bottom: 0; }
.add-test-panel h4 { margin: 0; color: var(--primary-dark); font-size: 15px; }
.add-test-panel p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.test-entry-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.add-test-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.project-admin-section { border: 1px solid #b9d4f5; border-radius: 8px; padding: 12px; background: white; display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.project-admin-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.danger-action { border: 1px solid #fecaca; background: #fff5f5; color: #991b1b; border-radius: 8px; padding: 9px 12px; cursor: pointer; font-weight: 800; }
.danger-action:hover { background: #fee2e2; }
.owner-section { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: rgba(255,255,255,0.78); display: grid; gap: 10px; margin-bottom: 16px; }
.project-owner-card { margin-bottom: 0; padding: 10px; background: white; }
.owner-section h4 { margin: 0; font-size: 14px; color: var(--primary-dark); }
.owner-section .collapsible-trigger span { font-size: 14px; color: #374151; }
.owner-section .collapsible-trigger strong { background: #f8fafc; color: var(--muted); border-color: var(--line); }
.project-owner-card .owner-select-row { grid-template-columns: 1fr auto; }
.owner-picker { display: grid; gap: 10px; }
.owner-select-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; align-items: center; }
.owner-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; align-items: center; }
.owner-chip { border: 1px solid #b9d4f5; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; font-size: 13px; font-weight: 800; }
.remove-owner { border: 0; background: white; color: #991b1b; border-radius: 999px; cursor: pointer; font-size: 11px; font-weight: 800; padding: 3px 7px; }
.remove-owner:hover { background: #fee2e2; }
.owner-select-row .secondary:disabled, .owner-select:disabled { opacity: .65; cursor: not-allowed; }
.secondary { border: 1px solid var(--line); background: white; color: var(--primary); border-radius: 8px; padding: 9px 12px; cursor: pointer; font-weight: 800; justify-self: start; }
.secondary:hover { background: var(--primary-soft); border-color: #b9d4f5; }
.empty-state { margin: 0; color: var(--muted); }
.progress { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #374151; background: #f9fafb; }
.badge { padding: 4px 8px; border-radius: 999px; font-size: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: inline-block; white-space: nowrap; }
.danger { background: #fee2e2; color: #991b1b; }
.success { background: #dcfce7; color: #166534; }
.warn { background: #fef3c7; color: #92400e; }
.project-status.planning { background: #e0f2fe; color: #075985; }
.project-status.active { background: #dcfce7; color: #166534; }
.project-status.paused { background: #fef3c7; color: #92400e; }
.project-status.completed { background: #ede9fe; color: #5b21b6; }
.demo-status.upcoming { background: #dbeafe; color: #1d4ed8; }
.demo-status.in-progress { background: #fef3c7; color: #92400e; }
.demo-status.completed { background: #dcfce7; color: #166534; }
dialog { width: min(760px, 95vw); border: 0; border-radius: 8px; box-shadow: 0 20px 80px rgba(0,0,0,.25); }
#formFields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; color: #374151; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; font-size: 13px; background: white; }
.checklist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.checklist-item { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; padding: 9px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }
.checklist-item input { width: auto; }
.list-text-field { display: grid; gap: 8px; }
.document-links-field { display: grid; gap: 10px; }
.document-link-entry { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(180px, 1fr) minmax(130px, .8fr) 38px; gap: 8px; align-items: center; }
.document-link-list, .document-link-view { margin: 4px 0 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.document-link-list li, .document-link-view li { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; padding: 10px; color: #4b5563; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.document-link-list li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.document-link-list strong, .document-link-view a, .document-link-view strong { display: block; color: var(--primary); font-weight: 800; margin-bottom: 4px; }
.document-link-list a { color: var(--primary); font-size: 12px; }
.document-link-list p, .document-link-view p { margin: 4px 0 0; color: #4b5563; }
.unit-serials { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.serial-unit-field { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; padding: 9px; display: grid; gap: 6px; }
.serial-unit-field span { color: var(--primary); font-size: 12px; font-weight: 800; }
.lined-input { line-height: 1.7; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.7em - 1px), #e5e7eb calc(1.7em - 1px), #e5e7eb 1.7em); background-attachment: local; }
textarea { resize: vertical; }
.list-builder { align-content: start; }
.list-entry { display: grid; grid-template-columns: 1fr 38px; gap: 8px; align-items: center; }
.icon-add { width: 38px; height: 38px; border: 1px solid #b9d4f5; border-radius: 8px; background: var(--primary-soft); color: var(--primary); cursor: pointer; font-size: 22px; font-weight: 800; line-height: 1; }
.icon-add:hover { background: #dcecff; border-color: #8dbced; }
.draft-list { margin: 4px 0 0; padding: 0; display: grid; gap: 6px; list-style: none; }
.draft-list li { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; color: #4b5563; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.draft-actions { display: flex; gap: 10px; }
.draft-edit { border: 0; background: transparent; color: var(--primary); cursor: pointer; font-weight: 700; padding: 0; }
.draft-remove { border: 0; background: transparent; color: #991b1b; cursor: pointer; font-weight: 700; padding: 0; }
menu { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 0 0; }
menu button { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.form-row { display: flex; gap: 10px; margin-bottom: 14px; }
.action { border: 0; color: #1d4ed8; background: transparent; cursor: pointer; font-weight: 700; }
.inline-link { border: 0; background: transparent; color: var(--primary); cursor: pointer; font: inherit; font-weight: 800; padding: 0; text-align: left; }
.inline-link:hover { text-decoration: underline; }
@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; }
  .topbar, .topbar-actions, .panel-heading { align-items: stretch; flex-direction: column; }
  .topbar-actions input { min-width: 0; }
  .cards { grid-template-columns: 1fr 1fr; }
  #formFields, .test-entry-form { grid-template-columns: 1fr; }
  .project-board { grid-template-columns: repeat(4, minmax(260px, 1fr)); }
  .project-dialog-hero, .project-dialog-insights { grid-template-columns: 1fr; }
  .project-dialog-metrics { min-width: 0; }
  .project-admin-section { grid-template-columns: 1fr; }
  .project-admin-actions { justify-content: flex-start; }
  .project-row { grid-template-columns: 1fr; }
  .demo-meta { grid-template-columns: 1fr; }
  .document-link-entry { grid-template-columns: 1fr; }
}
@media (max-width: 540px) { .cards, .demo-grid { grid-template-columns: 1fr; } .project-dialog-metrics { grid-template-columns: 1fr; } main { padding: 18px; } }

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b2f5b 0%, #1554a6 55%, #eef5fc 100%);
  padding: 24px;
}
.login-shell { width: min(420px, 100%); }
.login-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  padding: 32px 28px;
  display: grid;
  gap: 14px;
  text-align: center;
}
.login-logo {
  width: 210px;
  max-width: 100%;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  padding: 8px;
}
.login-card h1 { margin: 0; color: var(--primary-dark); font-size: 24px; }
.login-subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 14px; text-align: left; margin-top: 8px; }
.login-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: #374151; }
.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
}
.login-error {
  margin: 0;
  color: #991b1b;
  background: #fee2e2;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.login-submit { width: 100%; margin-top: 4px; }
