/* =========================================================
   iPost WMS — Professional layout (Manhattan/SAP EWM style)
   ========================================================= */
:root {
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --sidebar-bg: #0F172A;
  --sidebar-hover: #1E293B;
  --sidebar-active: #2563EB;
  --sidebar-text: #CBD5E1;
  --sidebar-text-dim: #64748B;
  --content-bg: #F1F5F9;
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --primary: #2563EB;
  --success: #059669;
  --warning: #F59E0B;
  --danger: #DC2626;
  --info: #0EA5E9;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--content-bg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #0F172A; }

/* ============ LOGIN ============ */
.login-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0F172A 0%, #1E40AF 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
}
.login-card {
  background: #fff; padding: 40px; border-radius: 16px;
  width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  position: relative;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand i { font-size: 3rem; color: var(--primary); }
.login-brand h2 { margin: 8px 0 4px; font-weight: 700; }
.login-brand p { color: #64748B; font-size: 0.85rem; margin: 0; }
.login-hint { text-align: center; margin-top: 16px; }

/* ============ APP LAYOUT ============ */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid #1E293B;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #1E293B;
}
.sidebar-brand i { font-size: 1.8rem; color: #60A5FA; }
.brand-title { font-weight: 700; font-size: 1.05rem; color: #fff; }
.brand-sub { font-size: 0.7rem; color: var(--sidebar-text-dim); }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}
.nav-section { margin-bottom: 16px; }
.nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--sidebar-text-dim);
  padding: 0 20px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-item.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--primary);
}
.nav-item i { font-size: 1.05rem; width: 20px; text-align: center; }

.sidebar-foot {
  padding: 12px 20px;
  border-top: 1px solid #1E293B;
  font-size: 0.78rem;
  color: var(--sidebar-text-dim);
}
.ws-state .dot {
  width: 8px; height: 8px;
  display: inline-block;
  background: #64748B;
  border-radius: 50%;
  margin-right: 6px;
}
.ws-state.online .dot { background: #10B981; box-shadow: 0 0 6px #10B981; }

/* ============ MAIN AREA ============ */
.main-area {
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}
.topbar-toggle {
  background: none; border: none; font-size: 1.5rem; color: #334155;
}
.topbar-search {
  flex: 1; max-width: 560px;
  position: relative;
  display: flex; align-items: center;
  background: #F1F5F9;
  border-radius: 8px;
  padding: 8px 14px;
}
.topbar-search i { color: #64748B; margin-right: 10px; }
.topbar-search input {
  background: none; border: none; outline: none;
  flex: 1; font-size: 0.92rem;
  color: #0F172A;
}
.topbar-search kbd {
  background: #fff;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  color: #64748B;
}

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.lang-switch { display: flex; gap: 2px; background: #F1F5F9; border-radius: 8px; padding: 3px; margin-right: 4px; }
.lang-switch button {
  border: none; background: transparent; color: #64748B;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.3px;
  padding: 5px 9px; border-radius: 6px; cursor: pointer;
}
.lang-switch button.active { background: #fff; color: var(--primary, #2563EB); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.lang-switch-login { position: absolute; top: 16px; right: 16px; }

.topbar-icon {
  background: none; border: none;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 1.15rem;
  color: #475569;
  cursor: pointer;
  position: relative;
  text-decoration: none;
}
.topbar-icon:hover { background: #F1F5F9; color: var(--primary); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: 8px;
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #1E40AF);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem;
}
.user-info { line-height: 1.2; }
.user-name { font-size: 0.85rem; font-weight: 600; color: #0F172A; }
.user-role { font-size: 0.7rem; color: #64748B; text-transform: uppercase; letter-spacing: 0.5px; }
.logout-btn { padding: 4px 8px; color: #64748B; }
.logout-btn:hover { color: var(--danger); }

/* ============ BREADCRUMB ============ */
.breadcrumb-bar {
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: #64748B;
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
}
.breadcrumb-bar i { font-size: 0.7rem; }

/* ============ CONTENT ============ */
.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ============ KPI CARDS ============ */
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.kpi-card .kpi-icon {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  background: rgba(37,99,235,0.1);
  color: var(--primary);
}
.kpi-card.danger .kpi-icon { background: rgba(220,38,38,0.1); color: var(--danger); }
.kpi-card.warn .kpi-icon   { background: rgba(245,158,11,0.1); color: var(--warning); }
.kpi-card.success .kpi-icon { background: rgba(5,150,105,0.1); color: var(--success); }
.kpi-card.info .kpi-icon   { background: rgba(14,165,233,0.1); color: var(--info); }
.kpi-card .kpi-label { font-size: 0.75rem; color: #64748B; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.kpi-card .kpi-value { font-size: 1.9rem; font-weight: 700; color: #0F172A; line-height: 1.1; margin-top: 4px; }
.kpi-card .kpi-sub { font-size: 0.8rem; color: #64748B; margin-top: 4px; }
.kpi-card.danger .kpi-value { color: var(--danger); }
.kpi-card.success .kpi-value { color: var(--success); }

/* ============ CARDS / TABLES ============ */
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}
.card-header {
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  font-weight: 600;
}
.card-body { padding: 16px 20px; }

.table-sm td, .table-sm th { padding: 0.45rem 0.6rem; font-size: 0.875rem; }
.table thead th { background: #F8FAFC; font-weight: 600; color: #475569; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.5px; }
.table-hover tbody tr:hover { background: #F8FAFC; }

/* ============ STATUS BADGES ============ */
.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-new { background: #E2E8F0; color: #475569; }
.status-track_registered, .status-china_warehouse, .status-sent_to_uz,
.status-at_china_border, .status-at_uz_border,
.status-customs, .status-transit_osh, .status-transit_ulugchat { background: #FFE0B2; color: #E65100; }
.status-sent_to_regional, .status-at_regional_warehouse, .status-at_pickup_point { background: #CFD8DC; color: #37474F; }
.bg-orange { background-color: #FB8C00 !important; }
.bg-purple { background-color: #7B1FA2 !important; }
.status-paid { background: #DBEAFE; color: #1E40AF; }
.status-sorted { background: #EDE9FE; color: #5B21B6; }
.status-picking_assigned { background: #FED7AA; color: #9A3412; }
.status-picking { background: #FEF3C7; color: #92400E; }
.status-in_bag { background: #CCFBF1; color: #115E59; }
.status-bag_closed { background: #D1FAE5; color: #065F46; }
.status-ready_to_ship { background: #DBEAFE; color: #1E40AF; }
.status-scanned_out { background: #E9D5FF; color: #6B21A8; }
.status-handed_to_driver { background: #FCE7F3; color: #9F1239; }
.status-in_delivery { background: #E0F2FE; color: #075985; }
.status-delivered { background: #D1FAE5; color: #065F46; }
.status-returned { background: #FEE2E2; color: #991B1B; }
.status-cancelled { background: #E2E8F0; color: #1F2937; }

.service-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}
.service-EMU    { background: #DBEAFE; color: #1E40AF; }
.service-Uzpost { background: #D1FAE5; color: #065F46; }
.service-BTS    { background: #FEF3C7; color: #92400E; }
.service-STAREX { background: #FEE2E2; color: #991B1B; }
.service-PVZ    { background: #E2E8F0; color: #475569; }
.service-Kuryer { background: #CFFAFE; color: #155E75; }
.service-iPost  { background: #FFEDD5; color: #7C2D12; }
.service-RELOG  { background: #F3E8FF; color: #581C87; }

/* ============ CLEARABLE FILTER INPUT ============ */
.input-clear-wrap { position: relative; display: inline-flex; }
.input-clear-wrap input { padding-right: 26px; }
.input-clear-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: #9CA3AF; font-size: 1.1rem;
  line-height: 1; cursor: pointer; display: none; padding: 2px 6px;
}
.input-clear-btn:hover { color: #374151; }

/* ============ PAYMENT-BY-SERVICE DONUT (Dashboard) ============ */
.payment-donut-wrap { position: relative; }
.payment-donut-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.payment-donut-num { font-size: 1.8rem; font-weight: 700; color: var(--text, #1F2937); line-height: 1; }
.payment-donut-label { font-size: 0.7rem; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.courier-list { display: flex; flex-direction: column; gap: 6px; }
.courier-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; background: #F8FAFC;
  cursor: pointer; transition: background 0.15s;
}
.courier-row:hover { background: #EEF2F7; }
.courier-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.courier-name { flex: 1; font-size: 0.85rem; font-weight: 600; color: var(--text, #1F2937); }
.courier-count { min-width: 28px; text-align: center; color: #fff; }

/* ============ TREK DETAIL MODAL (Yuklar) ============ */
.track-photo-box {
  width: 120px; height: 120px; border-radius: 10px;
  background: #F8FAFC; border: 1px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #94A3B8; font-size: 1.8rem; overflow: hidden;
}
.track-photo-box img { width: 100%; height: 100%; object-fit: cover; }
.track-timeline { position: relative; padding-left: 4px; max-height: 340px; overflow-y: auto; }
.track-timeline-item { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.track-timeline-item:not(:last-child)::before {
  content: ''; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: #E2E8F0;
}
.track-timeline-dot { color: var(--success, #16A34A); font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.track-timeline-body { padding-top: 1px; }

/* ============ GLOBAL SEARCH DROPDOWN ============ */
.search-dropdown {
  position: fixed;
  top: 56px;
  left: calc(var(--sidebar-w) + 28px);
  width: 560px;
  max-height: 480px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  z-index: 1100;
  overflow-y: auto;
}
.search-result {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.search-result:hover { background: #F1F5F9; }
.search-result .icon {
  width: 36px; height: 36px;
  background: #F1F5F9;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.search-result .body { flex: 1; }
.search-result .body .title { font-weight: 600; font-size: 0.9rem; }
.search-result .body .sub { font-size: 0.78rem; color: #64748B; }
.search-result .badge-r {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: #E2E8F0;
  color: #475569;
  border-radius: 12px;
}
.search-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #64748B;
  padding: 8px 16px 4px;
  background: #F8FAFC;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ============ NOTIFICATIONS PANEL ============ */
.notif-panel {
  position: fixed;
  top: var(--topbar-h);
  right: 16px;
  width: 380px;
  max-height: 70vh;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  z-index: 1100;
  display: flex; flex-direction: column;
}
.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  display: flex; gap: 12px;
}
.notif-item:hover { background: #F8FAFC; }
.notif-item .ic {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.notif-item.critical .ic { background: #FEE2E2; color: var(--danger); }
.notif-item.warning .ic  { background: #FEF3C7; color: var(--warning); }
.notif-item.info .ic     { background: #DBEAFE; color: var(--primary); }
.notif-item .body { flex: 1; min-width: 0; }
.notif-item .title { font-weight: 600; font-size: 0.88rem; color: #0F172A; }
.notif-item .sub { font-size: 0.78rem; color: #64748B; }

/* ============ RACKS (oldingidan saqlanadi) ============ */
.rack-cell {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: #e9ecef; border-radius: 3px; font-size: 0.65rem; font-weight: 500;
  color: #495057; cursor: pointer; flex-shrink: 0;
}
.rack-cell.occupied { background: #198754; color: white; }
.rack-cell.aging {
  background: #dc2626 !important; color: #fff; font-weight: 700;
  box-shadow: 0 0 0 1px #7f1d1d inset;
  animation: aging-pulse 2s infinite;
}
@keyframes aging-pulse {
  0%, 100% { box-shadow: 0 0 0 1px #7f1d1d inset, 0 0 0 0 rgba(220, 38, 38, 0.6); }
  50% { box-shadow: 0 0 0 1px #7f1d1d inset, 0 0 0 4px rgba(220, 38, 38, 0); }
}
.rack-cell:hover { box-shadow: 0 0 0 2px var(--primary); }

.rack-view { display: flex; flex-direction: column; gap: 10px; }
.floor-row {
  display: grid; grid-template-columns: 80px 1fr 1fr;
  align-items: center; gap: 8px;
  padding: 8px; background: #F8FAFC; border-radius: 6px;
}
.floor-label {
  font-weight: 700; font-size: 0.85rem; text-align: center;
  background: #475569; color: white; padding: 8px 4px; border-radius: 4px;
}
.floor-side { display: flex; align-items: center; gap: 6px; }
.side-tag {
  width: 22px; height: 22px; border-radius: 50%;
  background: #64748B; color: white; font-weight: 700; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}
.rack-row { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.rack-gap {
  width: 16px; height: 28px; background: repeating-linear-gradient(
    45deg, #adb5bd, #adb5bd 3px, #f8f9fa 3px, #f8f9fa 6px
  ); border-radius: 2px; flex-shrink: 0;
}

/* ============ AGING (qizil rows) ============ */
.aging-red {
  background-color: #FEF2F2 !important;
  border-left: 3px solid var(--danger);
}
.aging-red td { color: #7F1D1D; }
.aging-red code { color: #B91C1C; background: #FEE2E2; padding: 1px 4px; border-radius: 3px; }
#monthBtns .btn.active { background-color: var(--danger); color: #fff; border-color: var(--danger); }

/* ============ MISC ============ */
.btn-xs { font-size: 0.75rem; padding: 0.1rem 0.4rem; }
.real-time-pulse {
  animation: pulse 1.5s infinite;
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success);
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}

/* ============ Bugungi qabul hisoboti — funnel ============ */
.intake-funnel {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.intake-chip {
  background: #F8FAFC; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; text-align: center; min-width: 110px; flex: 1;
}
.intake-chip.good { background: #ECFDF5; border-color: #A7F3D0; }
.intake-chip.bad { background: #FEF2F2; border-color: #FECACA; }
.intake-num { font-size: 1.5rem; font-weight: 800; color: #0F172A; line-height: 1.1; }
.intake-chip.good .intake-num { color: var(--success); }
.intake-chip.bad .intake-num { color: var(--danger); }
.intake-label { font-size: 0.7rem; color: #64748B; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }
.intake-arrow { font-size: 1.3rem; color: #CBD5E1; flex-shrink: 0; }

/* ============ KPI — Podium & gamified leaderboard ============ */
.kpi-hero {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.kpi-live {
  font-size: 0.8rem; color: #64748B; display: flex; align-items: center; gap: 6px; margin-top: 2px;
}

.kpi-podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 16px; margin-bottom: 22px; min-height: 210px;
}
.podium-card {
  width: 150px; border-radius: 14px; padding: 16px 12px;
  text-align: center; color: #fff; position: relative; overflow: hidden;
  transition: transform 0.25s ease;
  animation: podium-rise 0.5s ease-out both;
}
.podium-card:hover { transform: translateY(-4px); }
.podium-card .medal { font-size: 2.2rem; line-height: 1; margin-bottom: 4px; }
.podium-card .p-name { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-card .p-points { font-size: 1.7rem; font-weight: 800; margin-top: 4px; }
.podium-card .p-points-label { font-size: 0.65rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; }
.podium-card.rank-1 {
  order: 2; height: 190px; padding-top: 22px;
  background: linear-gradient(160deg, #FFD54F, #F5A623 65%, #E08E0B);
  box-shadow: 0 10px 30px rgba(245, 166, 35, 0.45);
  animation: podium-rise 0.5s ease-out both, glow-gold 2.4s ease-in-out infinite 0.5s;
}
.podium-card.rank-2 {
  order: 1; height: 155px; align-self: flex-end;
  background: linear-gradient(160deg, #E2E8F0, #B8C2CC 65%, #94A3B8);
  box-shadow: 0 8px 22px rgba(148, 163, 184, 0.4);
}
.podium-card.rank-3 {
  order: 3; height: 130px; align-self: flex-end;
  background: linear-gradient(160deg, #E8B084, #CD8B5F 65%, #A86A44);
  box-shadow: 0 8px 22px rgba(168, 106, 68, 0.4);
}
.podium-card.rank-1::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  background-size: 200% 100%; animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; } 100% { background-position: -50% 0; }
}
@keyframes glow-gold {
  0%, 100% { box-shadow: 0 10px 30px rgba(245, 166, 35, 0.45); }
  50% { box-shadow: 0 10px 42px rgba(245, 166, 35, 0.75); }
}
@keyframes podium-rise {
  from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); }
}

.kpi-my-card {
  border-radius: 14px; padding: 18px; color: #fff;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}
.kpi-my-card .my-rank { font-size: 2.2rem; font-weight: 800; }
.kpi-my-card .my-points { font-size: 1.15rem; font-weight: 700; }
.kpi-my-card .my-sub { font-size: 0.8rem; opacity: 0.9; margin-top: 6px; }
.kpi-my-card .progress { background: rgba(255,255,255,0.25); }
.kpi-my-card .progress-bar { background: #FDE68A; }

.kpi-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.kpi-row:hover { background: #F8FAFC; }
.kpi-row.me { background: #EFF6FF; border-left: 3px solid var(--primary); }
.kpi-row .kpi-rank-num { width: 26px; font-weight: 700; color: #94A3B8; text-align: center; flex-shrink: 0; }
.kpi-row .kpi-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.kpi-row .kpi-row-main { flex: 1; min-width: 0; }
.kpi-row .kpi-row-name { font-weight: 600; font-size: 0.9rem; }
.kpi-row .kpi-row-bar { height: 6px; border-radius: 3px; background: #E2E8F0; margin-top: 4px; overflow: hidden; }
.kpi-row .kpi-row-bar-fill { height: 100%; background: linear-gradient(90deg, #60A5FA, #2563EB); border-radius: 3px; transition: width 0.6s ease; }
.kpi-row .kpi-row-points { font-weight: 700; font-size: 1rem; flex-shrink: 0; min-width: 50px; text-align: right; }
.bag-card { cursor: pointer; transition: transform 0.1s; }
.bag-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.bag-card.open { border-left: 3px solid var(--warning); }
.bag-card.closed { border-left: 3px solid var(--primary); }
.bag-card.shipped { border-left: 3px solid var(--success); }
.audit-row { font-family: 'SF Mono', Menlo, monospace; font-size: 0.82rem; }

/* Mobile */
@media (max-width: 768px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: -100%; top: 0; bottom: 0;
    width: var(--sidebar-w); z-index: 1000; transition: left 0.2s;
  }
  .sidebar.open { left: 0; }
  .search-dropdown { left: 16px; right: 16px; width: auto; }
}
