.i40-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:16px; }
.i40-tab {
  padding:8px 14px; border-radius:8px; border:1px solid rgba(148,163,184,.25);
  background:rgba(15,23,42,.6); color:#e2e8f0; cursor:pointer; font-size:12px;
}
.i40-tab.active { background:#1e9e3e; border-color:#1e9e3e; color:#fff; }
.i40-tab-panel { margin-bottom:20px; }
.i40-wo-row { padding:10px 0; border-bottom:1px solid rgba(148,163,184,.15); font-size:13px; }
#i40-map { height:320px; border-radius:12px; overflow:hidden; }
#i40-twin3d { min-height:280px; border-radius:12px; overflow:hidden; background:#0f172a; }
#i40-history-chart { max-height:280px; }
.admin-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
.admin-card { background:var(--card-bg,#fff); border-radius:12px; padding:16px; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.admin-row { padding:8px 0; border-bottom:1px solid #eee; font-size:13px; }
#auth-bar { display:flex; align-items:center; gap:10px; margin-left:auto; padding:0 12px; font-size:12px; color:rgba(255,255,255,.85); }
@media (max-width:900px) { .admin-grid { grid-template-columns:1fr; } }

.cal-i40-summary {
  display:flex; flex-wrap:wrap; align-items:center; gap:12px;
  padding:14px 18px; margin-bottom:16px; border-radius:12px;
  background:linear-gradient(135deg,#0f172a,#1e3a5f); color:#e2e8f0;
}
.cal-i40-kpi { text-align:center; min-width:72px; }
.cal-i40-kpi strong { display:block; font-size:20px; color:#4ade80; }
.cal-i40-kpi span { font-size:11px; color:#94a3b8; }
.cal-i40-pill { font-size:10px; background:#1e9e3e; color:#fff; padding:2px 6px; border-radius:99px; vertical-align:middle; }
.event-card-i40, .alert-card-i40 { border-left:3px solid #22c55e; }
.cal-i40-actions { margin-top:8px; display:flex; gap:6px; flex-wrap:wrap; }
.cal-i40-btn { font-size:11px !important; padding:4px 8px !important; }
.cal-month-title { font-weight:600; margin-bottom:8px; font-size:14px; }
.cal-month-days { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.cal-day { text-align:center; padding:6px 2px; font-size:12px; border-radius:6px; background:#f8fafc; }
.cal-day.has-event { background:#dbeafe; font-weight:600; }
.cal-day.has-i40 { background:#bbf7d0; box-shadow:inset 0 0 0 2px #22c55e; }
.cal-day.today { outline:2px solid var(--green-primary); }
.cal-day-empty { background:transparent; }

.sec-i40-host { margin-bottom:12px; }
.sec-i40-panel { margin-bottom:16px; }
.sec-i40-meta { font-size:12px; color:#64748b; margin:8px 0 0; width:100%; }
.sec-i40-badge { display:inline-block; font-size:10px; font-weight:700; padding:2px 6px; border-radius:99px; margin-left:4px; vertical-align:middle; }
.sec-i40-badge.good { background:#dcfce7; color:#166534; }
.sec-i40-badge.ok { background:#dbeafe; color:#1e40af; }
.sec-i40-badge.warning { background:#fef3c7; color:#92400e; }
.sec-i40-badge.critical { background:#fee2e2; color:#991b1b; }
.sec-i40-list-item { padding:10px; border-left:3px solid #f59e0b; margin-bottom:8px; background:#f8fafc; border-radius:0 8px 8px 0; font-size:13px; }
.sec-i40-list-item.critical { border-left-color:#ef4444; }
.sec-i40-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; }
.sec-i40-tile { padding:10px; background:#f8fafc; border-radius:8px; font-size:12px; border:1px solid #e2e8f0; }
.sec-i40-tile.critical { border-color:#fca5a5; background:#fef2f2; }
.sec-i40-tile.warning { border-color:#fcd34d; }
.sec-i40-filters { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; width:100%; }
.sec-i40-pillar { display:flex; align-items:center; gap:8px; margin-bottom:8px; font-size:12px; }
.sec-i40-bar-track { flex:1; height:6px; background:#e2e8f0; border-radius:99px; overflow:hidden; }
.eq-i40-panel { margin-bottom: 16px; }
.eq-i40-filter-bar { margin-bottom: 12px; }
.eq-i40-workers-list { max-height: 320px; overflow-y: auto; }
.eq-i40-worker-row { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; }
.eq-i40-worker-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.eq-i40-bar-track { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin: 4px 0; }
.eq-i40-bar-fill { height: 100%; background: linear-gradient(90deg, #1e9e3e, #38bdf8); }
.eq-i40-bar-fill.good { background: #22c55e; }
.eq-i40-bar-fill.ok { background: #3b82f6; }
.eq-i40-bar-fill.warn { background: #f59e0b; }
.eq-i40-gaps { max-height: 320px; overflow-y: auto; }
.eq-i40-gap-item { padding: 10px; margin-bottom: 8px; background: #fef2f2; border-left: 3px solid #ef4444; border-radius: 0 8px 8px 0; font-size: 12px; }
.eq-i40-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.eq-i40-status.eq-i40-ready { background: #dcfce7; color: #166534; }
.eq-i40-status.eq-i40-training { background: #fef3c7; color: #92400e; }
.eq-i40-status.eq-i40-risk { background: #fee2e2; color: #991b1b; }
.eq-i40-row.eq-i40-hidden { display: none; }
.equipe-card-i40 { border-color: #1e9e3e33; }
.equipe-card-risk { border-color: #fca5a5; background: #fffbfb; }
.eq-i40-team-score { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eq-i40-team-alert { font-size: 11px; color: #b91c1c; font-weight: 600; }
.eq-i40-team-bar { margin: 8px 0 12px; }
.eq-chip-good { border-color: #86efac; background: #f0fdf4; }
.eq-chip-ok { border-color: #93c5fd; background: #eff6ff; }
.eq-chip-warn { border-color: #fcd34d; background: #fffbeb; }

.prj-i40-panel { margin-bottom: 16px; }
.prj-i40-filter-bar { margin-bottom: 12px; }
.prj-i40-twin-list { max-height: 340px; overflow-y: auto; }
.prj-i40-twin-row { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; }
.prj-i40-twin-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; gap: 8px; }
.prj-i40-bar-track { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin: 4px 0; }
.prj-i40-bar-fill { height: 100%; background: linear-gradient(90deg, #1e9e3e, #38bdf8); }
.prj-i40-bar-fill.good { background: #22c55e; }
.prj-i40-bar-fill.ok { background: #3b82f6; }
.prj-i40-bar-fill.warn { background: #f59e0b; }
.prj-i40-gaps { max-height: 340px; overflow-y: auto; }
.prj-i40-gap-item { padding: 10px; margin-bottom: 8px; background: #fff7ed; border-left: 3px solid #f59e0b; border-radius: 0 8px 8px 0; font-size: 12px; }
.prj-i40-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.prj-i40-status.prj-i40-mature { background: #dcfce7; color: #166534; }
.prj-i40-status.prj-i40-developing { background: #dbeafe; color: #1e40af; }
.prj-i40-status.prj-i40-emerging { background: #fef3c7; color: #92400e; }
.prj-i40-row.prj-i40-hidden { display: none; }

.dash-i40-panel { margin-bottom: 16px; }
.dash-i40-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.dash-i40-oee-row { margin-bottom: 10px; font-size: 13px; }
.dash-i40-oee-row span { display: inline-block; min-width: 100px; }
.dash-i40-oee-total { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e2e8f0; font-size: 15px; display: flex; justify-content: space-between; }
.dash-i40-bar-track { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.dash-i40-bar-fill { height: 100%; background: linear-gradient(90deg, #1e9e3e, #38bdf8); }
.dash-i40-bar-fill.good { background: #22c55e; }
.dash-i40-bar-fill.ok { background: #3b82f6; }
.dash-i40-bar-fill.warn { background: #f59e0b; }
.dash-i40-alert-item { padding: 10px; margin-bottom: 8px; background: #f8fafc; border-left: 3px solid #f59e0b; border-radius: 0 8px 8px 0; font-size: 12px; }
.dash-i40-alert-item.critical { border-left-color: #ef4444; background: #fef2f2; }
.dash-i40-action-item { padding: 8px 0; border-bottom: 1px solid #e2e8f0; font-size: 12px; }
.dash-i40-quick-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dash-i40-proj-badge { margin-right: 6px; }

.equip-i40-panel { margin-bottom: 16px; }
.equip-i40-filter-bar { margin-bottom: 12px; }
.equip-i40-asset-list, .equip-i40-pred-list { max-height: 340px; overflow-y: auto; }
.equip-i40-asset-row { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #e2e8f0; font-size: 12px; }
.equip-i40-asset-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.equip-i40-pred-item { padding: 10px; margin-bottom: 8px; background: #f8fafc; border-left: 3px solid #f59e0b; border-radius: 0 8px 8px 0; font-size: 12px; }
.equip-i40-pred-item.critical { border-left-color: #ef4444; }
.equip-i40-btn { margin-top: 6px; }
.equip-i40-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.equip-i40-status.equip-i40-critical { background: #fee2e2; color: #991b1b; }
.equip-i40-status.equip-i40-warning { background: #fef3c7; color: #92400e; }
.equip-i40-status.equip-i40-good { background: #dcfce7; color: #166534; }
.equip-i40-status.equip-i40-ok { background: #dbeafe; color: #1e40af; }
.equip-i40-row.equip-i40-hidden { display: none; }
.equip-tel-online { color: #166534; font-size: 11px; }
.equip-tel-idle { color: #64748b; font-size: 11px; }
.equip-maint-late { color: #b91c1c; font-weight: 600; }
.equip-maint-urgent { color: #d97706; font-weight: 600; }
