/* ══════════════════════════════════════════════════════════════════
   UniConnect — UniUni Integration Portal
   Brand: Orange #FF6200, Navy #0a1628, Slate #1a2d4e
   ══════════════════════════════════════════════════════════════════ */

:root {
  --uc-orange: #FF6200;
  --uc-orange-light: #FF8C42;
  --uc-navy: #0a1628;
  --uc-slate: #1a2d4e;
  --uc-sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.uc-body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  display: flex;
  min-height: 100vh;
  color: #1e293b;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────── */
.uc-sidebar {
  width: var(--uc-sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #0a1628 0%, #0d1f3c 60%, #091526 100%);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.uc-sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.uc-logo-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--uc-orange), var(--uc-orange-light));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,98,0,0.35);
}

.uc-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.uc-nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  padding: 12px 8px 6px;
  margin-top: 4px;
}

.uc-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
  position: relative;
}

.uc-nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.9);
}

.uc-nav-item.active {
  background: linear-gradient(135deg, rgba(255,98,0,0.25), rgba(255,140,66,0.15));
  color: white;
  border: 1px solid rgba(255,98,0,0.3);
}

.uc-nav-item.active i { color: var(--uc-orange-light); }

.uc-nav-item i { width: 18px; text-align: center; flex-shrink: 0; }

.uc-badge {
  margin-left: auto;
  background: var(--uc-orange);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 7px;
  min-width: 20px;
  text-align: center;
}

.uc-badge-red {
  margin-left: auto;
  background: rgba(239,68,68,0.2);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
  font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 2px 7px;
}

.uc-badge-green {
  margin-left: auto;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.3);
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  border-radius: 8px; padding: 2px 7px;
}

.uc-badge-yellow {
  margin-left: auto;
  background: rgba(234,179,8,0.15);
  color: #fbbf24;
  border: 1px solid rgba(234,179,8,0.3);
  font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 2px 7px;
}

.uc-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.uc-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--uc-orange), var(--uc-orange-light));
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── MAIN CONTENT ─────────────────────────────────────────────────── */
.uc-main {
  margin-left: var(--uc-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ────────────────────────────────────────────────────────── */
.uc-topbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.uc-env-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
}

.uc-env-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: blink 2s infinite;
}

@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.uc-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.uc-icon-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.uc-icon-btn:hover { background: #f8fafc; border-color: #cbd5e1; }

/* ── PAGE CONTENT ─────────────────────────────────────────────────── */
.uc-page-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ── STAT CARDS ──────────────────────────────────────────────────── */
.uc-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.uc-stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.uc-stat-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.uc-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--uc-orange), var(--uc-orange-light));
}

.uc-stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.uc-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.uc-stat-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.uc-stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── CARDS ───────────────────────────────────────────────────────── */
.uc-card {
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 20px;
}

.uc-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}

.uc-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.uc-card-body { padding: 22px; }

/* ── TABLES ──────────────────────────────────────────────────────── */
.uc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.uc-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafafa;
}
.uc-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f8fafc;
  color: #374151;
  vertical-align: middle;
}
.uc-table tr:hover td { background: #fafcff; }
.uc-table tr:last-child td { border-bottom: none; }

/* ── BADGES / PILLS ──────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.pill-live { background:#dcfce7; color:#16a34a; border:1px solid #bbf7d0; }
.pill-uat { background:#dbeafe; color:#2563eb; border:1px solid #bfdbfe; }
.pill-testing { background:#fef9c3; color:#ca8a04; border:1px solid #fde047; }
.pill-discovery { background:#f3e8ff; color:#9333ea; border:1px solid #d8b4fe; }
.pill-completed { background:#dcfce7; color:#16a34a; }
.pill-in_progress { background:#dbeafe; color:#2563eb; }
.pill-pending { background:#f1f5f9; color:#64748b; }
.pill-blocked { background:#fee2e2; color:#dc2626; }
.pill-open { background:#fef3c7; color:#d97706; }
.pill-investigating { background:#dbeafe; color:#2563eb; }
.pill-resolved { background:#dcfce7; color:#16a34a; }
.pill-escalated { background:#fee2e2; color:#dc2626; }
.pill-critical { background:#fee2e2; color:#dc2626; border:1px solid #fecaca; }
.pill-high { background:#ffedd5; color:#ea580c; border:1px solid #fed7aa; }
.pill-medium { background:#fef9c3; color:#ca8a04; border:1px solid #fde047; }
.pill-low { background:#f0fdf4; color:#16a34a; border:1px solid #bbf7d0; }
.pill-delivered { background:#dcfce7; color:#16a34a; }
.pill-in_transit { background:#dbeafe; color:#2563eb; }
.pill-exception { background:#fee2e2; color:#dc2626; }
.pill-label_created { background:#f1f5f9; color:#64748b; }
.pill-out_for_delivery { background:#f0fdf4; color:#16a34a; }

/* ── BUTTONS ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--uc-orange), var(--uc-orange-light));
  color: white;
  box-shadow: 0 2px 8px rgba(255,98,0,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(255,98,0,0.4); }

.btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #e2e8f0;
}
.btn-secondary:hover { background: #f8fafc; }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
  border: 1px solid rgba(239,68,68,0.2);
}

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

/* ── FORMS ────────────────────────────────────────────────────────── */
.uc-form-group { margin-bottom: 16px; }
.uc-label { font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 6px; display: block; }
.uc-input, .uc-select, .uc-textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  color: #374151;
  background: white;
  transition: all 0.2s;
  outline: none;
}
.uc-input:focus, .uc-select:focus, .uc-textarea:focus {
  border-color: var(--uc-orange);
  box-shadow: 0 0 0 3px rgba(255,98,0,0.12);
}
.uc-textarea { resize: vertical; min-height: 80px; }

/* ── API SANDBOX ─────────────────────────────────────────────────── */
.uc-code-panel {
  background: #0d1117;
  border-radius: 12px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 380px;
  overflow-y: auto;
  position: relative;
}

.uc-code-panel .json-key { color: #79c0ff; }
.uc-code-panel .json-str { color: #a5d6ff; }
.uc-code-panel .json-num { color: #f2cc60; }
.uc-code-panel .json-bool { color: #ff7b72; }
.uc-code-panel .json-null { color: #8b949e; }

.uc-method-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.method-post { background:#dbeafe; color:#1d4ed8; }
.method-get { background:#dcfce7; color:#16a34a; }
.method-patch { background:#fef9c3; color:#b45309; }
.method-delete { background:#fee2e2; color:#dc2626; }

.uc-http-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.status-2xx { background:#dcfce7; color:#16a34a; }
.status-4xx { background:#fef3c7; color:#d97706; }
.status-5xx { background:#fee2e2; color:#dc2626; }

/* ── TRACKING TIMELINE ────────────────────────────────────────────── */
.uc-timeline { position: relative; padding-left: 28px; }
.uc-timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 0; bottom: 0;
  width: 2px;
  background: #e2e8f0;
}
.uc-timeline-item { position: relative; padding-bottom: 20px; }
.uc-timeline-dot {
  position: absolute;
  left: -23px;
  top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: white;
  border: 2px solid #cbd5e1;
  display: flex; align-items: center; justify-content: center;
}
.uc-timeline-dot.active {
  background: var(--uc-orange);
  border-color: var(--uc-orange);
  box-shadow: 0 0 0 4px rgba(255,98,0,0.15);
}
.uc-timeline-dot.completed {
  background: #22c55e;
  border-color: #22c55e;
}

/* ── PIPELINE / KANBAN ────────────────────────────────────────────── */
.uc-pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.uc-pipeline-col {
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 14px;
}

.uc-pipeline-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid;
}

.uc-client-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.uc-client-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
  border-color: var(--uc-orange);
}

/* ── TOAST ────────────────────────────────────────────────────────── */
.uc-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: slide-in 0.3s ease;
}

@keyframes slide-in { from { transform: translateX(120%); opacity:0; } to { transform: translateX(0); opacity:1; } }

.uc-toast.success { background:#16a34a; color:white; }
.uc-toast.error { background:#dc2626; color:white; }
.uc-toast.info { background:#2563eb; color:white; }
.uc-toast.warning { background:#d97706; color:white; }

/* ── MODAL ────────────────────────────────────────────────────────── */
.uc-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.uc-modal-box {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  animation: modal-in 0.25s ease;
}

@keyframes modal-in { from { transform: scale(0.95) translateY(20px); opacity:0; } to { transform: scale(1) translateY(0); opacity:1; } }

.uc-modal-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── LOADING SKELETON ─────────────────────────────────────────────── */
.uc-skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── PROGRESS BAR ─────────────────────────────────────────────────── */
.uc-progress {
  background: #f1f5f9;
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
}

.uc-progress-bar {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--uc-orange), var(--uc-orange-light));
  transition: width 0.6s ease;
}

/* ── GRID HELPERS ─────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── SCROLLBAR ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .uc-sidebar { transform: translateX(-100%); }
  .uc-sidebar.open { transform: translateX(0); }
  .uc-main { margin-left: 0; }
  .uc-pipeline { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .uc-page-content { padding: 16px; }
  .uc-topbar { padding: 12px 16px; }
  .uc-pipeline { grid-template-columns: 1fr; }
  .uc-stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── MISC UTILITIES ──────────────────────────────────────────────── */
.text-orange { color: var(--uc-orange); }
.bg-orange { background: var(--uc-orange); }
.border-orange { border-color: var(--uc-orange); }
.text-navy { color: var(--uc-navy); }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-mono { font-family: 'Courier New', monospace; }
.cursor-pointer { cursor: pointer; }
.opacity-60 { opacity: 0.6; }
.divider { border: none; border-top: 1px solid #f1f5f9; margin: 16px 0; }
