/* OCC-specific styles — fullscreen layout */

/* ─── OCC LAYOUT ─── */
.occ-layout { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* ─── VIEW TABS (header center) ─── */
.view-tabs { display: flex; gap: 2px; background: rgba(26,47,78,0.4); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.view-tab { display: flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); border: none; background: none; font-family: inherit; transition: all 0.15s; }
.view-tab:hover { color: var(--text); background: rgba(59,130,246,0.06); }
.view-tab.active { background: var(--navy); color: var(--text); }
.view-tab i { font-size: 13px; }

/* ─── MAIN CANVAS (mimic board area) ─── */
.occ-canvas { flex: 1; position: relative; overflow: hidden; background: var(--bg); min-height: 0; min-width: 0; }

/* ─── MIMIC BOARD SVG ─── */
#mimic-svg { width: 100%; height: 100%; display: block; cursor: crosshair; }

/* ─── TRAIN MARKER styles (applied via JS/SVG) ─── */
.train-ontime   { fill: #10D9A0; }
.train-warning  { fill: #FBBF24; }
.train-alert    { fill: #FB923C; }
.train-critical { fill: #F87171; }
.train-unknown  { fill: #5E7FA8; }

/* ─── CANVAS TOOLBAR (floating top-left) ─── */
.canvas-toolbar {
  position: absolute; top: 12px; left: 12px; z-index: 10;
  display: flex; flex-direction: column; gap: 4px;
}
.toolbar-btn {
  width: 34px; height: 34px; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: 14px; transition: all 0.15s;
}
.toolbar-btn:hover { border-color: var(--accent); color: var(--accent2); background: rgba(59,130,246,0.08); }
.toolbar-btn.active { background: var(--navy); color: var(--accent2); border-color: var(--accent); }

/* ─── LINTAS SELECTOR (floating top-right of canvas) ─── */
.lintas-selector {
  position: absolute; top: 12px; left: 56px; z-index: 10;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 10px 4px 10px; font-size: 11.5px; color: var(--text);
  font-family: inherit; cursor: pointer;
}
.lintas-selector:focus { outline: none; border-color: var(--accent); }

/* ─── LEGEND (bottom-left of canvas) ─── */
.map-legend {
  position: absolute; bottom: 12px; left: 12px; z-index: 10;
  background: rgba(13,21,38,0.85); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.legend-title { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ld-ontime   { background: #10D9A0; }
.ld-warning  { background: #FBBF24; }
.ld-alert    { background: #FB923C; }
.ld-critical { background: #F87171; }
.ld-unknown  { background: #5E7FA8; }

/* ─── RIGHT PANEL (alerts + incidents) ─── */
.occ-right { width: 300px; background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.right-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.right-tab { flex: 1; padding: 10px 8px; font-size: 11px; font-weight: 600; cursor: pointer; text-align: center; color: var(--muted); border-bottom: 2px solid transparent; transition: all 0.15s; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 5px; }
.right-tab:hover { color: var(--text); }
.right-tab.active { color: var(--accent2); border-bottom-color: var(--accent); }
.right-badge { background: var(--red); color: #fff; font-size: 9px; font-weight: 700; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.right-badge.amber, .right-badge-amber { background: var(--amber); color: #080E1A; }
.right-panel-body { flex: 1; overflow-y: auto; }

/* Alert item in right panel */
.occ-alert-item { padding: 10px 12px; border-bottom: 1px solid rgba(26,47,78,0.5); cursor: pointer; transition: background 0.15s; }
.occ-alert-item:hover { background: rgba(59,130,246,0.05); }
.occ-alert-item.crit { border-left: 3px solid var(--red); }
.occ-alert-item.high { border-left: 3px solid var(--amber); }
.occ-alert-item.warn { border-left: 3px solid var(--accent); }
.alert-row1 { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.alert-kano { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; color: var(--text); }
.alert-type { font-size: 10px; color: var(--muted); }
.alert-ack-btn { margin-left: auto; padding: 2px 8px; border-radius: 5px; font-size: 10px; font-weight: 600; border: 1px solid rgba(59,130,246,0.3); background: rgba(59,130,246,0.08); color: var(--accent2); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.alert-ack-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.alert-detail { font-size: 11px; color: var(--muted); }
.alert-ts { font-size: 10px; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

/* Incident item in right panel */
.occ-incident-item { padding: 10px 12px; border-bottom: 1px solid rgba(26,47,78,0.5); cursor: pointer; transition: background 0.15s; }
.occ-incident-item:hover { background: rgba(59,130,246,0.05); }
.inc-header { display: flex; align-items: flex-start; gap: 6px; }
.inc-nomor { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); }
.inc-title { font-size: 12px; font-weight: 600; color: var(--text); margin: 2px 0; }
.inc-meta  { font-size: 10.5px; color: var(--muted); display: flex; gap: 8px; }

/* ─── TRAIN DETAIL DRAWER (right side) ─── */
.train-detail-drawer {
  position: absolute; right: 300px; top: 0; bottom: 0; width: 280px;
  background: var(--panel); border-left: 1px solid var(--border);
  display: none; flex-direction: column; z-index: 20; overflow: hidden;
}
.train-detail-drawer.open { display: flex; }
.tdd-hdr { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.tdd-ka-no { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; color: var(--text); }
.tdd-ka-name { font-size: 11px; color: var(--muted); margin-top: 1px; }
.tdd-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; transition: color 0.15s; }
.tdd-close:hover { color: var(--red); }
.tdd-body { flex: 1; overflow-y: auto; }
.tdd-section { padding: 12px 14px; border-bottom: 1px solid rgba(26,47,78,0.5); }
.tdd-sec-title { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.tdd-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.tdd-key { font-size: 11.5px; color: var(--muted); }
.tdd-val { font-size: 11.5px; font-weight: 600; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.tdd-val.green  { color: var(--green); }
.tdd-val.amber  { color: var(--amber); }
.tdd-val.red    { color: var(--red); }

/* Schedule table in train detail */
.sched-table { width: 100%; border-collapse: collapse; }
.sched-table th { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 4px 0; font-weight: 700; }
.sched-table td { font-size: 11px; padding: 5px 0; border-top: 1px solid rgba(26,47,78,0.4); font-family: 'JetBrains Mono', monospace; color: var(--text); }
.sched-table .sched-sta { font-family: inherit; font-size: 11px; color: var(--muted); }
.sched-table .sched-dev-pos { color: var(--amber); }
.sched-table .sched-dev-neg { color: var(--green); }

/* Crew row */
.crew-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.crew-avatar { width: 28px; height: 28px; background: linear-gradient(135deg,var(--navy),#2563EB); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
.crew-name { font-size: 11.5px; font-weight: 600; color: var(--text); }
.crew-role { font-size: 10px; color: var(--muted); }
.crew-health { margin-left: auto; }

/* Integration placeholder */
.integ-placeholder { display: flex; align-items: center; gap: 6px; padding: 8px 0; font-size: 11px; color: var(--muted); }
.integ-placeholder i { color: var(--border); }

/* ─── TOOLTIP ─── */
.occ-tooltip {
  position: absolute; z-index: 50; pointer-events: none;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.tooltip-header { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.tooltip-row { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); padding: 1px 0; }
.tooltip-row span { color: var(--text); font-weight: 600; font-family: 'JetBrains Mono', monospace; }

/* ─── LINTAS BADGE (floating canvas label) ─── */
.lintas-label {
  position: absolute; bottom: 12px; right: 12px; z-index: 10;
  background: rgba(13,21,38,0.85); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 11px; color: var(--muted);
}
.lintas-label strong { color: var(--text); font-weight: 700; }
