/* ============================================================
   SANDEFJORD BOLIGPROSJEKT – TIMELINE DASHBOARD CSS V2.1
   Vertikal tidslinje venstre · Innhold midten · Dokumenter høyre
   ============================================================ */

:root {
  --primary: #1f4e79; --primary-light: #2e75b6; --primary-dark: #14324d;
  --accent: #d97706; --danger: #b91c1c; --success: #15803d; --warning: #f59e0b;
  --bg: #f8fafc; --bg-secondary: #f1f5f9; --card: #ffffff;
  --text: #1c2b36; --text-secondary: #475569; --muted: #64748b;
  --border: #e2e8f0; --shadow: 0 2px 8px rgba(15,36,56,0.06); --shadow-lg: 0 8px 24px rgba(15,36,56,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 14px; }

#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- SHARE BARS ---------- */
.share-bar-top { background: var(--primary); color: #fff; padding: 8px 24px; display: flex; justify-content: center; border-bottom: 1px solid rgba(255,255,255,.1); }
.share-bar-bottom { background: var(--primary); color: #fff; padding: 12px 24px; display: flex; justify-content: center; border-top: 1px solid rgba(255,255,255,.1); }
.share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; font-weight: 600; font-size: .85rem; cursor: pointer; transition: .25s; }
.share-btn:hover { background: rgba(255,255,255,.25); }

/* ---------- TOPBAR ---------- */
.topbar { height: 64px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 300; backdrop-filter: blur(8px); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-toggle { display: none; background: none; border: none; padding: 8px; cursor: pointer; color: var(--text); border-radius: 8px; }
.menu-toggle:hover { background: var(--bg-secondary); }
.topbar-left-content { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.logo { font-size: 1.05rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.project-subtitle { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-center { display: flex; align-items: center; gap: 12px; }
.project-status { display: flex; align-items: center; gap: 10px; }
.status-badge { padding: 4px 12px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.status-badge.status-active { background: #dcfce7; color: #166534; }
.status-badge.status-planned { background: #dbeafe; color: #1e40af; }
.status-badge.status-future { background: #f1f5f9; color: #64748b; }
.timeline-progress { font-size: .75rem; font-weight: 700; color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.header-badges { display: flex; gap: 6px; }
.badge { padding: 4px 10px; border-radius: 20px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.badge.decision { background: #fef3c7; color: #92400e; }
.badge.score { background: #dbeafe; color: #1e40af; }
.badge.risk { background: #fee2e2; color: #991b1b; }
.btn-print { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: .82rem; cursor: pointer; transition: .25s; }
.btn-print:hover { background: var(--bg-secondary); border-color: var(--primary-light); }

/* ---------- MAIN LAYOUT (3 columns) ---------- */
.main-layout { display: grid; grid-template-columns: 280px minmax(0,1fr) 360px; gap: 0; flex: 1; align-items: start; }

/* ---------- LEFT: VERTICAL TIMELINE ---------- */
.left-timeline-sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; z-index: 100; }
.left-sidebar-header { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.left-sidebar-header h3 { font-size: .82rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.mini-progress { display: flex; flex-direction: column; gap: 6px; }
.mini-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.mini-progress-fill { height: 100%; background: linear-gradient(90deg, var(--success), var(--accent), var(--primary)); border-radius: 3px; transition: width .5s ease; width: 0%; }
.progress-percent { font-size: .7rem; font-weight: 700; color: var(--muted); }
.left-timeline-nav { flex: 1; display: flex; flex-direction: column; gap: 6px; position: relative; }
.left-timeline-phase { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; transition: .25s; border: 1px solid transparent; }
.left-timeline-phase:hover { background: var(--bg-secondary); border-color: var(--border); }
.left-timeline-phase.phase-current { background: #eff6ff; border-color: var(--primary-light); }
.left-phase-marker { position: relative; flex-shrink: 0; width: 22px; height: 22px; }
.marker-ring { position: absolute; inset: 0; border: 2px solid var(--border); border-radius: 50%; background: #fff; transition: .25s; }
.marker-ring.active { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31,78,121,.15); }
.marker-dot { position: absolute; top: 7px; left: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: .25s; }
.left-timeline-phase.phase-current .marker-dot { background: var(--primary); }
.marker-pulse { position: absolute; inset: 0; border-radius: 50%; background: var(--primary); opacity: .3; animation: pulse 2s infinite; display: none; }
.left-timeline-phase.phase-current .marker-pulse { display: block; }
@keyframes pulse { 0%{transform:scale(1);opacity:.35} 50%{transform:scale(1.6);opacity:0} 100%{transform:scale(1);opacity:0} }
.left-phase-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.left-phase-label { font-size: .62rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; }
.left-phase-name { font-size: .78rem; font-weight: 600; color: var(--text); }
.left-phase-time { font-size: .68rem; color: var(--muted); }
.left-phase-status { align-self: flex-start; font-size: .58rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }
.left-phase-status.active { background: #dcfce7; color: #166534; }
.left-phase-status.planned { background: #dbeafe; color: #1e40af; }
.left-phase-status.future { background: #f1f5f9; color: #64748b; }
.left-timeline-progress-vertical { position: relative; width: 4px; margin: 14px auto 0; height: 90px; background: var(--border); border-radius: 2px; overflow: hidden; }
.vertical-progress-fill { width: 100%; background: linear-gradient(to bottom, var(--success), var(--accent), var(--primary)); transition: height .5s ease; height: 0%; }
.vertical-markers { position: absolute; inset: 0; }
.left-sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.project-meta { display: flex; flex-direction: column; gap: 3px; font-size: .68rem; color: var(--muted); }

/* ---------- CENTER: MAIN CONTENT ---------- */
.main-content { padding: 24px 28px 60px; min-width: 0; }
.page-header { padding: 4px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.header-content { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.page-header h1 { font-size: 1.65rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.page-subtitle { font-size: .9rem; color: var(--muted); }
.header-right { flex-shrink: 0; }
.phase-indicator { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.phase-label { font-size: .62rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.current-phase-badge { font-size: .82rem; font-weight: 600; color: var(--primary); background: #eff6ff; padding: 5px 14px; border-radius: 20px; }

/* ---------- TIMELINE SCROLLYTELLING ---------- */
.timeline-container { position: relative; }
.timeline-vertical { position: relative; padding-left: 34px; }
.timeline-line { position: absolute; left: 16px; top: 0; bottom: 0; width: 3px; background: var(--border); border-radius: 2px; }
.timeline-progress-fill { position: absolute; left: 0; top: 0; width: 100%; background: linear-gradient(to bottom, var(--success), var(--accent), var(--primary)); border-radius: 2px; transition: height .4s ease; height: 0%; }
.timeline-phase { position: relative; padding-left: 38px; margin-bottom: 32px; }
.timeline-marker { position: absolute; left: -34px; top: 10px; width: 30px; height: 30px; z-index: 2; }
.timeline-marker .marker-ring { width: 22px; height: 22px; top: 4px; left: 4px; }
.timeline-marker .marker-ring.active { border-color: var(--primary); box-shadow: 0 0 0 5px rgba(31,78,121,.15); }
.timeline-marker .marker-dot { width: 10px; height: 10px; top: 10px; left: 10px; }
.timeline-phase.phase-current .timeline-marker .marker-dot { background: var(--primary); }
.timeline-marker .marker-pulse { width: 22px; height: 22px; top: 4px; left: 4px; }
.timeline-phase.phase-current .timeline-marker .marker-pulse { display: block; }
.marker-complete { background: var(--success) !important; }
.phase-content { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 26px; box-shadow: var(--shadow); }
.timeline-phase.phase-current .phase-content { border-color: var(--primary-light); box-shadow: 0 4px 18px rgba(31,78,121,.12); }
.phase-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.phase-number { font-size: .68rem; font-weight: 700; color: #fff; background: var(--primary); padding: 4px 10px; border-radius: 6px; text-transform: uppercase; letter-spacing: .5px; }
.phase-status { padding: 3px 10px; border-radius: 16px; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.phase-status.status-active { background: #dcfce7; color: #166534; }
.phase-status.status-planned { background: #dbeafe; color: #1e40af; }
.phase-status.status-future { background: #f1f5f9; color: #64748b; }
.phase-status.status-complete { background: #dcfce7; color: #166534; }
.phase-timeframe { font-size: .78rem; color: var(--muted); font-weight: 600; }
.phase-content h2 { font-size: 1.3rem; color: var(--primary); margin-bottom: 8px; }
.phase-description { color: var(--text-secondary); margin-bottom: 20px; }
.phase-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 20px; }
.detail-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.detail-card h4 { font-size: .82rem; font-weight: 700; color: var(--primary); margin-bottom: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.detail-card ul, .detail-card ol { margin: 0; padding-left: 18px; }
.detail-card li { margin: 5px 0; font-size: .82rem; color: var(--text-secondary); }
.document-links { display: flex; flex-direction: column; gap: 7px; }
.document-links .doc-link { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 11px; background: #fff; border: 1px solid var(--border); border-radius: 8px; color: var(--primary); font-size: .78rem; font-weight: 600; cursor: pointer; text-align: left; transition: .2s; }
.document-links .doc-link:hover { background: var(--bg-secondary); border-color: var(--primary-light); }
.phase-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
.timeline-end-marker { position: relative; margin-left: -26px; display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.timeline-end-marker .marker-ring { position: relative; width: 24px; height: 24px; }
.timeline-end-marker .marker-dot { top: 8px; left: 8px; width: 8px; height: 8px; }
.end-label { font-size: .85rem; font-weight: 700; color: var(--success); }

/* ---------- BUTTONS ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 8px; font-weight: 600; font-size: .82rem; text-decoration: none; cursor: pointer; transition: .25s; border: none; }
.btn-primary { background: var(--primary); color: #fff; } .btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--accent); color: #fff; } .btn-secondary:hover { background: #b45309; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); } .btn-outline:hover { background: var(--primary); color: #fff; }

/* ---------- CONTENT SECTIONS ---------- */
.content-section { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 26px; margin-top: 28px; box-shadow: var(--shadow); }
.content-section h2 { font-size: 1.25rem; color: var(--primary); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-light); }
.content-section h3 { font-size: 1rem; color: var(--primary); margin: 16px 0 8px; }
.content-section p { color: var(--text-secondary); margin-bottom: 10px; }
.content-section table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .85rem; }
.content-section th { background: var(--primary); color: #fff; padding: 9px 12px; text-align: left; font-weight: 600; }
.content-section td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.content-section tr:nth-child(even) td { background: var(--bg); }
.content-section ol, .content-section ul { padding-left: 22px; margin-bottom: 10px; }
.content-section li { margin: 5px 0; color: var(--text-secondary); }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; padding: 14px 16px; border-radius: 10px; margin: 12px 0; font-size: .85rem; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; padding: 14px 16px; border-radius: 10px; margin: 12px 0; font-size: .85rem; }
.download-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; padding: 12px; background: var(--bg); border-radius: 8px; font-size: .8rem; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-color { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border); display: inline-block; }

/* ---------- MAPS / 3D ---------- */
#wmsMap { height: 480px; border-radius: 10px; border: 1px solid var(--border); margin-top: 12px; }
#viewer3d { height: 480px; border-radius: 10px; border: 1px solid var(--border); margin-top: 12px; background: #0e1a26; position: relative; overflow: hidden; }
#viewer3d canvas { display: block; }
.viewer-badge { position: absolute; top: 12px; left: 12px; z-index: 5; background: rgba(15,36,56,.85); color: #fff; padding: 6px 12px; border-radius: 8px; font-size: .72rem; font-weight: 600; }
.viewer-controls { position: absolute; top: 12px; right: 12px; z-index: 5; display: flex; gap: 6px; }
.viewer-controls button { background: rgba(15,36,56,.85); color: #fff; border: 1px solid rgba(255,255,255,.25); padding: 6px 12px; border-radius: 8px; font-size: .72rem; font-weight: 700; cursor: pointer; }
.viewer-controls button.aktiv { background: var(--accent); }

/* ---------- FORECAST TOOLS ---------- */
.forecasting-tools { background: linear-gradient(135deg, #eff6ff, #dbeafe); border: 1px solid #bfdbfe; border-radius: 12px; padding: 20px; }
.forecast-tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.forecast-tool { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.forecast-tool h4 { font-size: .85rem; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.tool-inputs { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.input-row { display: flex; gap: 10px; }
.input-group { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.input-group label { font-size: .7rem; font-weight: 700; color: var(--text-secondary); }
.input-group input, .input-group select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .82rem; background: #fff; }
.btn-run-forecast { width: 100%; padding: 10px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-weight: 700; font-size: .82rem; cursor: pointer; }
.btn-run-forecast:hover { background: var(--primary-dark); }
.tool-result { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 12px; }
.result-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: .8rem; }
.result-row:last-child { border-bottom: none; }
.result-label { color: var(--text-secondary); }
.result-value { font-weight: 700; color: var(--primary); }

/* ---------- RIGHT: DOC SIDEBAR ---------- */
.right-doc-sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); background: #fff; border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; z-index: 100; }
.right-sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.right-sidebar-header h3 { font-size: .85rem; font-weight: 700; color: var(--primary); }
.sidebar-toggle { display: none; background: none; border: none; padding: 8px; cursor: pointer; color: var(--muted); border-radius: 8px; }
.sidebar-toggle:hover { background: var(--bg-secondary); }
.right-sidebar-content { flex: 1; overflow-y: auto; padding: 14px; }
.doc-search { margin-bottom: 12px; }
.doc-search input { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px; font-size: .82rem; background: var(--bg); }
.doc-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,78,121,.1); }
.doc-categories { display: flex; flex-direction: column; gap: 14px; }
.doc-category { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 13px; }
.doc-category h4 { font-size: .74rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.doc-category ul { list-style: none; margin: 0; padding: 0; }
.doc-category li { margin: 0 0 6px; }
.doc-link { display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; font-size: .76rem; font-weight: 600; cursor: pointer; transition: .2s; text-align: left; }
.doc-link:hover { background: var(--bg-secondary); border-color: var(--primary-light); color: var(--primary); }
.sidebar-actions { display: flex; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- FOOTER ---------- */
.footer { text-align: center; padding: 26px 20px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--border); margin-top: 36px; }
.footer p:last-child { font-size: .74rem; opacity: .8; margin-top: 4px; }

/* ---------- MODALS ---------- */
.share-modal-overlay, .report-modal { position: fixed; inset: 0; background: rgba(15,36,56,.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.share-modal-overlay.active, .report-modal.active { display: flex; }
.share-modal, .report-modal { background: #fff; border-radius: 14px; max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.close-modal { background: none; border: none; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 1.4rem; display: flex; align-items: center; justify-content: center; }
.close-modal:hover { background: var(--bg-secondary); color: var(--text); }
.modal-body { padding: 20px 22px; }
.share-input-group { display: flex; gap: 8px; margin-bottom: 14px; }
.share-input-group input { flex: 1; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; background: var(--bg); }
.btn-copy { padding: 11px 16px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-weight: 700; font-size: .82rem; cursor: pointer; white-space: nowrap; }
.btn-copy:hover { background: var(--primary-dark); }
.share-password { margin-bottom: 16px; }
.share-password label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 7px; }
.share-password input { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; margin-bottom: 6px; }
.share-password small { display: block; font-size: .72rem; color: var(--muted); }
.share-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--border); }
.report-header { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.report-header h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.report-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { padding: 3px 10px; border-radius: 12px; font-size: .62rem; font-weight: 700; text-transform: uppercase; background: #f1f5f9; color: #64748b; }
.tag.status-pending { background: #fef3c7; color: #92400e; }
.tag.status-complete { background: #dcfce7; color: #166534; }
.report-sections { display: flex; flex-direction: column; gap: 10px; }
.report-sections details { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.report-sections summary { cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--primary); list-style: none; }
.report-sections summary::-webkit-details-marker { display: none; }
.report-sections summary::before { content: '▸ '; transition: .2s; display: inline-block; }
.report-sections details[open] summary::before { transform: rotate(90deg); }
.report-content { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: .82rem; }
.report-content ul { padding-left: 18px; }
.note { font-size: .78rem; color: #92400e; margin-top: 10px; padding: 10px; background: #fffbeb; border-radius: 8px; border: 1px solid #fcd34d; }

/* ---------- RISK ---------- */
.risk-high { background: #fef2f2; border-left: 4px solid var(--danger); padding: 12px 16px; margin: 8px 0; border-radius: 0 8px 8px 0; font-size: .85rem; }
.risk-medium { background: #fffbeb; border-left: 4px solid var(--accent); padding: 12px 16px; margin: 8px 0; border-radius: 0 8px 8px 0; font-size: .85rem; }
.risk-low { background: #f0fdf4; border-left: 4px solid var(--success); padding: 12px 16px; margin: 8px 0; border-radius: 0 8px 8px 0; font-size: .85rem; }

/* ---------- TOAST ---------- */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 12px 24px; border-radius: 10px; font-weight: 700; font-size: .85rem; z-index: 2000; box-shadow: var(--shadow-lg); animation: toastIn .3s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1400px) { .main-layout { grid-template-columns: 250px minmax(0,1fr) 320px; } }
@media (max-width: 1100px) {
  .main-layout { grid-template-columns: 230px minmax(0,1fr); }
  .right-doc-sidebar { display: none; }
  .right-doc-sidebar.open { display: flex; position: fixed; right: 0; top: 64px; width: 360px; max-width: 92vw; height: calc(100vh - 64px); box-shadow: var(--shadow-lg); z-index: 400; }
  .sidebar-toggle { display: flex; }
}
@media (max-width: 820px) {
  .main-layout { grid-template-columns: 1fr; }
  .left-timeline-sidebar { display: none; position: fixed; left: 0; top: 64px; width: 280px; height: calc(100vh - 64px); z-index: 400; box-shadow: var(--shadow-lg); }
  .left-timeline-sidebar.open { display: flex; }
  .menu-toggle { display: flex; }
  .topbar-center { display: none; }
  .header-badges .badge.risk { display: none; }
  .main-content { padding: 16px 14px 50px; }
  .timeline-phase { padding-left: 30px; }
  .timeline-vertical { padding-left: 24px; }
  .timeline-line { left: 11px; }
  .timeline-marker { left: -30px; }
}

/* ---------- PRINT ---------- */
@media print {
  .share-bar-top, .share-bar-bottom, .topbar, .left-timeline-sidebar, .right-doc-sidebar,
  .btn, .menu-toggle, .sidebar-toggle, .share-btn, .btn-print, .modal-header,
  .share-modal-overlay, .report-modal, .viewer-controls, .viewer-badge { display: none !important; }
  .main-layout { display: block; }
  .main-content { padding: 0; }
  .content-section, .phase-content { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; break-inside: avoid; }
  .timeline-phase { page-break-inside: avoid; break-inside: avoid; }
  #wmsMap, #viewer3d { height: 380px; }
  @page { size: A4; margin: 14mm; }
}

/* ---------- VERTICAL MARKERS (JS-genererte) ---------- */
.vertical-marker { position: absolute; left: -6px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--border); box-shadow: 0 0 0 1px #fff; transform: translateY(-50%); }
.vertical-marker:first-child { top: 0 !important; }
.vertical-marker:last-child { top: 100% !important; }
