/* ── Command Center ─────────────────────────────────────────────────────── */
.rifd-command-center {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(7, 23, 80, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
  color: #e8eef8;
  font-family: inherit;
  transition: opacity .2s;
}
.rifd-command-center.cc-hidden { display: none; }
.rifd-command-center.cc-visible { display: flex; }

.cc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.cc-header h2 { margin: 0; font-size: 22px; font-weight: 700; color: #a8d8ea; }
.cc-refresh-btn {
  background: rgba(168,216,234,.15); border: 1px solid rgba(168,216,234,.3);
  color: #a8d8ea; border-radius: 8px; padding: 6px 10px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  transition: background .15s;
}
.cc-refresh-btn:hover { background: rgba(168,216,234,.25); }

/* KPIs */
.cc-kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.cc-kpi {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 14px 16px; text-align: center;
  transition: background .15s;
}
.cc-kpi-warn { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.35); }
.cc-kpi-info { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.35); }
.cc-kpi-value { display: block; font-size: 28px; font-weight: 700; color: #fff; }
.cc-kpi-warn .cc-kpi-value { color: #fbbf24; }
.cc-kpi-info .cc-kpi-value { color: #60a5fa; }
.cc-kpi-label { font-size: 12px; color: #94a3b8; margin-top: 2px; display: block; }

/* Sections */
.cc-section { margin-bottom: 24px; }
.cc-section-title { font-size: 14px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 12px; }
.cc-warn-title { color: #fbbf24; }

/* Delayed */
.cc-delayed-list { display: flex; flex-direction: column; gap: 8px; }
.cc-delayed-item {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25);
  border-radius: 8px; padding: 10px 14px; gap: 12px;
}
.cc-delayed-code { font-family: monospace; font-size: 13px; color: #fbbf24; font-weight: 700; }
.cc-delayed-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.cc-age { color: #94a3b8; font-size: 12px; }

/* Status bars */
.cc-status-bars { display: flex; flex-direction: column; gap: 8px; }
.cc-bar-row { display: grid; grid-template-columns: 120px 1fr 36px; align-items: center; gap: 10px; }
.cc-bar-label { font-size: 12px; color: #94a3b8; text-align: end; }
.cc-bar-track { height: 8px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.cc-bar-fill { height: 100%; border-radius: 4px; background: #17a98c; min-width: 2px; transition: width .4s; }
.cc-bar-new { background: #64748b; }
.cc-bar-under_review { background: #3b82f6; }
.cc-bar-approved { background: #6366f1; }
.cc-bar-preparing { background: #f59e0b; }
.cc-bar-ready { background: #10b981; }
.cc-bar-delivered { background: #17a98c; }
.cc-bar-count { font-size: 12px; color: #cbd5e1; text-align: center; }

/* Recent */
.cc-recent-list { display: flex; flex-direction: column; gap: 6px; }
.cc-recent-item {
  display: grid; grid-template-columns: 130px 1fr auto auto;
  align-items: center; gap: 12px;
  background: rgba(255,255,255,.04); border-radius: 8px; padding: 8px 14px;
  font-size: 13px;
}
.cc-recent-no { font-family: monospace; color: #a8d8ea; font-size: 12px; }
.cc-recent-name { color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-recent-age { color: #64748b; font-size: 12px; }

/* Pills */
.cc-pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.cc-status-new { background: rgba(100,116,139,.3); color: #94a3b8; }
.cc-status-under_review { background: rgba(59,130,246,.25); color: #93c5fd; }
.cc-status-approved { background: rgba(99,102,241,.25); color: #a5b4fc; }
.cc-status-preparing { background: rgba(245,158,11,.25); color: #fcd34d; }
.cc-status-ready { background: rgba(16,185,129,.25); color: #6ee7b7; }
.cc-status-delivered, .cc-status-closed, .cc-status-completed { background: rgba(23,169,140,.25); color: #5eead4; }
.cc-status-rejected, .cc-status-cancelled { background: rgba(239,68,68,.2); color: #fca5a5; }
.cc-status-in_progress { background: rgba(168,85,247,.25); color: #d8b4fe; }

/* WF form */
.cc-wf-section { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 16px; }
.cc-wf-form { display: flex; flex-direction: column; gap: 10px; }
.cc-wf-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.cc-wf-row label { font-size: 13px; color: #cbd5e1; }
.cc-wf-input-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #94a3b8; }
.cc-wf-input {
  width: 72px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  color: #e2e8f0; border-radius: 6px; padding: 4px 8px; font-size: 13px; text-align: center;
}
.cc-wf-input:focus { outline: 2px solid #17a98c; border-color: transparent; }
.cc-save-btn {
  align-self: flex-start; background: #17a98c; color: #fff; border: none;
  border-radius: 8px; padding: 8px 18px; font-size: 14px; cursor: pointer;
  font-weight: 600; transition: background .15s; margin-top: 4px;
}
.cc-save-btn:hover { background: #139e82; }
.cc-save-btn:disabled { opacity: .5; cursor: not-allowed; }

.cc-updated-at { font-size: 11px; color: #475569; text-align: center; margin-top: 8px; }
.cc-loading { text-align: center; padding: 60px; color: #64748b; }

/* Toasts */
.cc-toasts { position: fixed; bottom: 24px; left: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.cc-toast { background: #1e293b; border: 1px solid rgba(255,255,255,.15); color: #e2e8f0; border-radius: 8px; padding: 10px 16px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.4); animation: ccToastIn .2s ease; }
.cc-toast-error { border-color: rgba(239,68,68,.4); color: #fca5a5; }
@keyframes ccToastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Nav button */
.cc-nav-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(23,169,140,.15); border: 1px solid rgba(23,169,140,.3);
  color: #5eead4; border-radius: 8px; padding: 8px 14px;
  font-size: 13px; cursor: pointer; width: 100%;
  margin-top: 8px; transition: background .15s;
}
.cc-nav-btn:hover { background: rgba(23,169,140,.25); }

@media (max-width: 600px) {
  .rifd-command-center { padding: 16px; }
  .cc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cc-recent-item { grid-template-columns: 1fr auto; }
  .cc-recent-no, .cc-recent-age { display: none; }
}
