/* Organizational Chart Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); min-height: 100vh; color: #e2e8f0; }

.header { background: rgba(255,255,255,0.05); padding: 1.5rem 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; }
.header h1 { font-size: 1.5rem; font-weight: 600; }
.header .stats { display: flex; gap: 2rem; }
.header .stat { text-align: center; }
.header .stat-value { font-size: 1.5rem; font-weight: 700; color: #3b82f6; }
.header .stat-label { font-size: 0.75rem; color: #94a3b8; }

.controls { background: rgba(255,255,255,0.03); padding: 1rem 2rem; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.controls label { font-size: 0.875rem; color: #94a3b8; }
.controls select, .controls input { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #e2e8f0; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.875rem; }
.controls button { background: #3b82f6; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.875rem; }
.controls button:hover { background: #2563eb; }

.container { padding: 2rem; overflow-x: auto; }

.org-tree { display: flex; flex-direction: column; align-items: center; }
.org-level { display: flex; justify-content: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }

.org-node { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 1rem; min-width: 180px; max-width: 220px; cursor: pointer; transition: all 0.2s; position: relative; }
.org-node:hover { border-color: #3b82f6; transform: translateY(-2px); box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2); }
.org-node.expanded { border-color: #3b82f6; }
.org-node .node-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.org-node .node-title { font-weight: 600; font-size: 0.875rem; color: #fff; }
.org-node .node-badge { font-size: 0.65rem; padding: 0.15rem 0.4rem; border-radius: 4px; background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.org-node .node-officer { font-size: 0.75rem; color: #94a3b8; margin-bottom: 0.5rem; }
.org-node .node-stats { display: flex; gap: 0.75rem; font-size: 0.7rem; }
.org-node .node-stat { display: flex; flex-direction: column; }
.org-node .node-stat-value { font-weight: 600; color: #10b981; }
.org-node .node-stat-label { color: #64748b; }

.org-node.row-officer { border-left: 3px solid #f59e0b; }
.org-node.judicial { border-left: 3px solid #8b5cf6; }
.org-node.administrative { border-left: 3px solid #3b82f6; }
.org-node.human-services { border-left: 3px solid #10b981; }
.org-node.public-safety { border-left: 3px solid #ef4444; }
.org-node.infrastructure { border-left: 3px solid #64748b; }

.division-header { background: rgba(255,255,255,0.03); border-radius: 8px; padding: 0.75rem 1.5rem; margin-bottom: 1rem; text-align: center; }
.division-header h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.division-header p { font-size: 0.75rem; color: #94a3b8; }

.connector { width: 2px; height: 30px; background: rgba(255,255,255,0.2); margin: 0 auto; }
.horizontal-line { height: 2px; background: rgba(255,255,255,0.2); margin-bottom: 30px; }

.details-panel { position: fixed; right: 0; top: 0; width: 400px; height: 100vh; background: #1e293b; border-left: 1px solid rgba(255,255,255,0.1); padding: 2rem; transform: translateX(100%); transition: transform 0.3s; overflow-y: auto; z-index: 100; }
.details-panel.open { transform: translateX(0); }
.details-panel .close-btn { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: #94a3b8; font-size: 1.5rem; cursor: pointer; }
.details-panel h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.details-panel .officer-name { color: #94a3b8; margin-bottom: 1.5rem; }
.details-panel .stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.details-panel .stat-card { background: rgba(255,255,255,0.05); padding: 1rem; border-radius: 8px; }
.details-panel .stat-card .value { font-size: 1.5rem; font-weight: 700; color: #3b82f6; }
.details-panel .stat-card .label { font-size: 0.75rem; color: #94a3b8; }
.details-panel h3 { font-size: 0.875rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: #94a3b8; }
.details-panel .sub-dept { background: rgba(255,255,255,0.03); padding: 0.75rem; border-radius: 6px; margin-bottom: 0.5rem; display: flex; justify-content: space-between; }
.details-panel .sub-dept .name { font-size: 0.875rem; }
.details-panel .sub-dept .staff { font-size: 0.875rem; color: #10b981; }

.oee-grade { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 6px; font-weight: 600; margin-top: 0.5rem; }
.oee-grade.world-class { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.oee-grade.good { background: rgba(132, 204, 22, 0.2); color: #84cc16; }
.oee-grade.acceptable { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.oee-grade.needs-improvement { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.oee-grade.critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.legend { display: flex; gap: 1.5rem; justify-content: center; padding: 1rem; background: rgba(255,255,255,0.03); border-radius: 8px; margin-bottom: 2rem; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }

.footer { text-align: center; padding: 2rem; color: #64748b; font-size: 0.875rem; border-top: 1px solid rgba(255,255,255,0.05); }

@media (max-width: 768px) {
  .org-level { flex-direction: column; align-items: center; }
  .details-panel { width: 100%; }
  .header .stats { display: none; }
}
