/*
* demo.css
* File include item demo only specific css only
******************************************************************************/

/* ===== CSS VARIABLES ===== */
:root {
  --ou-width: 300px;
  --ou-bg: #0f172a;
  --ou-surface: #1e293b;
  --ou-border: rgba(99, 102, 241, 0.15);
  --ou-accent: #6366f1;
  --ou-accent2: #06b6d4;
  --ou-text: #e2e8f0;
  --ou-muted: #64748b;
  --ou-online: #10b981;
}

/* ===== LAYOUT ===== */
.menu .app-brand.demo {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
}

.menu .app-brand .app-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu .app-brand .app-logo {
  max-height: 64px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (max-width: 768px) {
  .menu .app-brand .app-logo {
    max-height: 40px;
    max-width: 140px;
  }
}

/* ===== SIDEBAR USER PROFILE CARD ===== */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 8px;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.sidebar-user-card:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* Avatar */
.sidebar-user-avatar {
  position: relative;
  flex-shrink: 0;
}

.sidebar-user-avatar img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid rgba(99, 102, 241, 0.3);
  display: block;
}

.sidebar-user-initials {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: white;
  font-size: 13px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

/* Online dot di avatar */
.sidebar-user-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: sidebar-dot-glow 2s ease-in-out infinite;
}

@keyframes sidebar-dot-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

/* Info teks */
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 700;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-bottom: 3px;
}

/* Level badge */
.sidebar-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.sidebar-level-badge.admin {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.sidebar-level-badge.sales {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.sidebar-level-badge.manager {
  background: rgba(167, 139, 250, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(167, 139, 250, 0.25);
}

/* Tombol online users di dalam card */
#onlineUsersBtn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

#onlineUsersBtn:hover {
  transform: scale(1.15) rotate(8deg);
  box-shadow: 0 5px 18px rgba(99, 102, 241, 0.6);
}

#onlineUsersBtn:active {
  transform: scale(0.92);
}

.ou-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: white;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid white;
  animation: badge-pop 2s ease-in-out infinite;
}

@keyframes badge-pop {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}

/* ===== NAVBAR TRANSPARENT ===== */
.layout-navbar {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.navbar.bg-navbar-theme {
  background: transparent !important;
}

.content-wrapper .navbar {
  z-index: auto;
}

/* ===== LAYOUT SPACING ===== */
.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: 76px !important;
}
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 64px !important;
}

/* ===== DEMO HELPERS ===== */
.demo-blocks > * { display: block !important; }
.demo-inline-spacing > * { margin: 1rem 0.375rem 0 0 !important; }
.demo-vertical-spacing > * { margin-top: 1rem !important; margin-bottom: 0 !important; }
.demo-vertical-spacing.demo-only-element > :first-child { margin-top: 0 !important; }
.demo-vertical-spacing-lg > * { margin-top: 1.875rem !important; margin-bottom: 0 !important; }
.demo-vertical-spacing-lg.demo-only-element > :first-child { margin-top: 0 !important; }
.demo-vertical-spacing-xl > * { margin-top: 5rem !important; margin-bottom: 0 !important; }
.demo-vertical-spacing-xl.demo-only-element > :first-child { margin-top: 0 !important; }
.rtl-only { display: none !important; text-align: left !important; direction: ltr !important; }
[dir='rtl'] .rtl-only { display: block !important; }

/* ===== MISC COMPONENTS ===== */
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row label { font-size: 16px; font-weight: 600; color: #555; }
.color-row input[type="color"] { width: 40px; height: 24px; padding: 0; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; }

.badge-success-bordered {
  color: #16a34a;
  border: 2px solid #16a34a;
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-block;
}
.badge-danger-bordered {
  color: #dc2626;
  border: 2px solid #dc2626;
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-block;
}

.select2-container { width: 100% !important; }
.select2-selection--single { height: 38px !important; display: flex !important; align-items: center !important; }
.select2-selection__rendered { line-height: 36px !important; }
.select2-selection__arrow { height: 36px !important; }

@media (max-width: 576px) {
  .qty-row .form-label { font-size: 12px; margin-bottom: 4px; }
  .qty-row .form-control { padding: 6px; font-size: 14px; }
}

/* ===== LOADING OVERLAY ===== */
#loading-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}
.loading-spinner { text-align: center; }
.loading-spinner .spinner-border { width: 4rem; height: 4rem; border-width: 0.4rem; }
.loading-text { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
body.loading-active { overflow: hidden; }

/* ===== ONLINE USERS SIDEBAR ===== */

/* Backdrop */
#ouBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#ouBackdrop.active { opacity: 1; pointer-events: all; }

/* Sidebar panel */
#onlineUsersSidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--ou-width);
  height: 100vh;
  background: var(--ou-bg);
  z-index: 1051;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -16px 0 50px rgba(0, 0, 0, 0.55);
}
#onlineUsersSidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981, #6366f1);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  z-index: 1;
}
@keyframes shimmer {
  from { background-position: 0% 0%; }
  to   { background-position: 200% 0%; }
}
#onlineUsersSidebar.active { transform: translateX(0); }

/* Header */
.ou-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--ou-border);
  flex-shrink: 0;
}
.ou-header-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ou-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ou-text);
  letter-spacing: 0.3px;
}
.ou-title-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.ou-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ou-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.ou-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  transform: rotate(90deg);
}

/* Stats */
.ou-stats { display: flex; gap: 6px; }
.ou-stat {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ou-border);
  border-radius: 8px;
  padding: 7px 6px;
  text-align: center;
}
.ou-stat-num {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.ou-stat-label {
  font-size: 8px;
  color: var(--ou-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-top: 2px;
}

/* Search */
.ou-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ou-border);
  flex-shrink: 0;
}
.ou-search-wrap { position: relative; }
.ou-search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  pointer-events: none;
  opacity: 0.5;
}
.ou-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ou-border);
  border-radius: 8px;
  padding: 7px 10px 7px 30px;
  color: var(--ou-text);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
  font-family: 'Public Sans', sans-serif;
}
.ou-search-input::placeholder { color: var(--ou-muted); }
.ou-search-input:focus { border-color: var(--ou-accent); }

/* User List */
.ou-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}
.ou-list::-webkit-scrollbar { width: 3px; }
.ou-list::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }

.ou-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ou-muted);
  padding: 6px 2px 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ou-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ou-border);
}

/* User card */
.ou-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 3px;
  border: 1px solid transparent;
  transition: all 0.18s;
  animation: card-in 0.35s ease both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ou-user-card:hover {
  background: rgba(99, 102, 241, 0.07);
  border-color: var(--ou-border);
  transform: translateX(-1px);
}
.ou-user-card.is-you {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.18);
}

/* Avatar */
.ou-avatar { position: relative; flex-shrink: 0; }
.ou-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid rgba(99, 102, 241, 0.25);
}
.ou-avatar-initials {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: white;
  letter-spacing: 0.5px;
}
.ou-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: var(--ou-online);
  border-radius: 50%;
  border: 2px solid var(--ou-bg);
  animation: dot-glow 2s ease-in-out infinite;
}
@keyframes dot-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50%       { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0); }
}

.ou-user-info { flex: 1; min-width: 0; }
.ou-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ou-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ou-you-badge {
  font-size: 8px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: white;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  flex-shrink: 0;
}
.ou-user-role {
  font-size: 10px;
  color: var(--ou-muted);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.ou-level-Admin   { color: #f59e0b !important; }
.ou-level-Sales   { color: #06b6d4 !important; }
.ou-level-Manager { color: #a78bfa !important; }
.ou-user-time {
  font-size: 9px;
  color: #334155;
  text-align: right;
  flex-shrink: 0;
  max-width: 60px;
}

/* Skeleton */
.ou-skeleton {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 3px;
  border-radius: 10px;
  animation: skel-wave 1.4s ease-in-out infinite;
}
@keyframes skel-wave {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.55; }
}
.ou-skel-avatar { width: 40px; height: 40px; border-radius: 10px; background: #1e293b; flex-shrink: 0; }
.ou-skel-lines { flex: 1; }
.ou-skel-line { height: 9px; background: #1e293b; border-radius: 5px; margin-bottom: 5px; }
.ou-skel-line:last-child { width: 55%; margin: 0; }

/* Empty state */
.ou-empty { padding: 36px 16px; text-align: center; color: var(--ou-muted); }
.ou-empty-icon { font-size: 36px; margin-bottom: 8px; opacity: 0.3; }
.ou-empty p { font-size: 12px; margin: 0; }

/* Footer */
.ou-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--ou-border);
  flex-shrink: 0;
}
.ou-refresh-btn {
  width: 100%;
  padding: 9px 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 8px;
  color: var(--ou-accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: 'Public Sans', sans-serif;
}
.ou-refresh-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}
.spin { animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }