/* ==========================================================================
   OSSi Admin Dashboard - Main Stylesheet
   ========================================================================== */

:root {
  /* Brand */
  --deep-magenta: #D6218C;
  --pink: #E12F7C;
  --red-pink: #EE4A60;
  --bright-red: #F02C3F;
  --orange: #FC7C3A;
  --green: #4CAF50;
  --red: #F44336;
  --blue: #2196F3;
  --yellow: #FFEB3B;
  --purple: #9C27B0;

  /* Grayscale */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Semantic aliases */
  --primary: var(--deep-magenta);
  --primary-light: #e649a4;
  --primary-dark: #b01870;

  --sidebar-bg: #ffffff;
  --sidebar-text: var(--gray-700);
  --sidebar-text-muted: var(--gray-500);
  --sidebar-hover-bg: var(--gray-100);
  --sidebar-active-bg: var(--deep-magenta);
  --sidebar-active-text: #ffffff;
  --sidebar-border: var(--gray-200);

  --sidebar-width: 268px;
  --sidebar-collapsed: 80px;

  /* Shared surface system */
  --surface-page:
    radial-gradient(circle at top left, rgba(214, 33, 140, 0.08), transparent 22%),
    linear-gradient(180deg, #faf7fb 0%, #f6f7fb 100%);
  --surface-card: rgba(255, 255, 255, 0.96);
  --surface-card-alt: #ffffff;
  --surface-soft: #f7f4f8;
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --border-light: var(--gray-200);
  --border-strong: rgba(214, 33, 140, 0.18);
  --shadow-sm: 0 8px 24px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 18px 40px rgba(17, 24, 39, 0.08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --topbar-height: 78px;
  --content-max: 1680px;
}

body {
  background: var(--surface-page);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

a {
  color: inherit;
}

.container-fluid {
  max-width: var(--content-max);
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.94)),
    var(--sidebar-bg);
  color: var(--sidebar-text);
  height: 100vh;
  position: fixed;
  transition: width 0.2s ease;
  z-index: 1000;
  box-shadow: 12px 0 30px rgba(17, 24, 39, 0.04);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* Header */
.sidebar-header {
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: -0.01em;
  margin: 0;
}

.sidebar-brand-block {
  min-width: 0;
}

.sidebar-home-link,
.sidebar-logo-link {
  text-decoration: none;
  color: inherit;
}

.sidebar-home-link:hover .brand-text,
.sidebar-logo-link:hover {
  opacity: 0.92;
}

.sidebar-profile {
  margin-top: 0.2rem;
}

.sidebar-profile-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gray-700);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.sidebar-profile-role {
  font-size: 0.66rem;
  color: var(--gray-500);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Toggle buttons */
#toggleSidebar,
#closeSidebar {
  background-color: var(--gray-100);
  border: none;
  color: var(--gray-600);
  border-radius: 7px;
  padding: 0.2rem 0.45rem;
  transition: all 0.15s;
  font-size: 0.82rem;
}
#toggleSidebar:hover,
#closeSidebar:hover {
  background-color: var(--primary);
  color: white;
}

/* Logo circle */
.logo-circle {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  overflow: hidden;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
  border: 1px solid rgba(214, 33, 140, 0.14);
  transition: all 0.2s;
}
.sidebar.collapsed .logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin: 1rem auto;
}
.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Menu container */
.sidebar-menu {
  flex: 1;
  padding: 0 0.7rem 0.85rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}
.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border-radius: 4px;
}

/* Menu items */
.menu-item {
  padding: 0.68rem 0.85rem;
  color: var(--sidebar-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  border-radius: 14px;
  transition: all 0.15s;
  margin: 0.15rem 0;
  font-weight: 500;
  font-size: 0.82rem;
  border: 1px solid transparent;
}

.menu-item:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--primary);
  border-color: rgba(214, 33, 140, 0.08);
}

.menu-item.active {
  background: linear-gradient(135deg, var(--deep-magenta), var(--red-pink));
  color: white;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(214, 33, 140, 0.18);
}

.menu-item i:first-child {
  font-size: 1rem;
  min-width: 1.5rem;
  color: var(--gray-500);
  transition: color 0.15s;
}
.menu-item:hover i:first-child {
  color: var(--primary);
}
.menu-item.active i:first-child {
  color: white;
}

/* Menu text */
.menu-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapsed state */
.sidebar.collapsed .menu-text,
.sidebar.collapsed .badge,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-footer .text-muted,
.sidebar.collapsed .btn-outline-light span {
  display: none;
}
.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 0.52rem 0;
}
.sidebar.collapsed .menu-item i:first-child {
  margin-right: 0;
  font-size: 1.05rem;
  min-width: auto;
}
.sidebar.collapsed .menu-group .bi-chevron-down {
  display: none;
}

/* Badges */
.badge {
  margin-left: 0.35rem;
  background: linear-gradient(135deg, var(--deep-magenta), var(--red-pink)) !important;
  color: white;
  font-weight: 600;
  font-size: 0.62rem;
  padding: 0.2rem 0.42rem;
  border-radius: 30px;
}

/* Sidebar nav counters (global, updated from load-sidebar + admin.js) */
.sidebar-nav-badge {
  min-width: 1.25rem;
  text-align: center;
}

/* Mağaza Ödemeleri — yeni talep (requested) sayısı */
#navShopPayments.sidebar-badge--incoming {
  display: inline-block !important;
  animation: sidebarIncomingPulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.45);
}

@keyframes sidebarIncomingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.35);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

/* Separator */
.separator {
  height: 1px;
  background-color: var(--sidebar-border);
  margin: 0.55rem 0.75rem;
}

/* Submenu (collapse) */
.submenu {
  padding-left: 0.95rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.submenu.show {
  max-height: 500px;
}
.submenu .menu-item {
  padding: 0.42rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 400;
}

/* Chevron icon */
.menu-item .bi-chevron-down {
  font-size: 0.68rem;
  transition: transform 0.2s;
}
.menu-item[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 0.9rem 0.85rem 1rem;
  border-top: 1px solid var(--sidebar-border);
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(249,250,251,0.95));
}
#datetime {
  color: var(--gray-500);
  font-size: 0.72rem;
  margin-bottom: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.btn-outline-light {
  border: 1px solid var(--gray-300);
  background: var(--surface-soft);
  color: var(--gray-700);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
  font-size: 0.78rem;
  transition: all 0.15s;
}
.btn-outline-light:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}
.btn-outline-light i {
  margin-right: 0.28rem;
}

.floating-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 62px;
  height: 62px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--deep-magenta), var(--primary-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 14px 34px rgba(214, 33, 140, 0.28);
  z-index: 1105;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.floating-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(214, 33, 140, 0.34);
}

.floating-chat-launcher:focus-visible {
  outline: 3px solid rgba(214, 33, 140, 0.18);
  outline-offset: 3px;
}

/* ===== Main Content ===== */
.main-content {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.2s ease;
  min-height: 100vh;
  background: transparent;
}

body.chat-popup .main-content {
  margin-left: 0 !important;
}

body.chat-popup .floating-chat-launcher,
body.chat-popup .sidebar {
  display: none !important;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* Top Bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.top-bar h1,
.top-bar h4,
.top-bar h5 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.top-bar .text-muted,
.top-bar small {
  color: var(--text-muted) !important;
}
.search-bar {
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 500px;
  border: 1px solid var(--border-light);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.03);
  transition: border 0.15s, box-shadow 0.15s;
}
.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(214, 33, 140, 0.08);
}
.search-bar input {
  border: none;
  background: transparent;
  width: 100%;
  padding: 0.25rem 0.5rem;
}
.search-bar input:focus {
  outline: none;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* Cards (unchanged, but using new colors) */
.card {
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--surface-card);
  overflow: hidden;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border-light) !important;
  padding: 1rem 1.25rem !important;
}
.card-body,
.card-footer {
  padding: 1.25rem;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pill {
  display: inline-block;
  padding: 0.38rem 0.85rem;
  background: rgba(214, 33, 140, 0.08);
  border-radius: 50px;
  font-size: 0.76rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--deep-magenta);
  font-weight: 700;
  border: 1px solid rgba(214, 33, 140, 0.08);
}

/* Bootstrap normalization */
.btn {
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.62rem 0.95rem;
  box-shadow: none !important;
}
.btn-sm {
  border-radius: 10px;
  font-size: 0.78rem;
  padding: 0.42rem 0.72rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--deep-magenta), var(--red-pink));
  border-color: transparent;
}
.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--primary-dark), var(--deep-magenta));
  border-color: transparent;
}
.btn-success {
  background: linear-gradient(135deg, #27ae60, #3ccf7a);
  border-color: transparent;
}
.btn-outline-primary {
  color: var(--primary);
  border-color: rgba(214, 33, 140, 0.22);
  background: #fff;
}
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-light:hover {
  color: #fff;
}
.btn-outline-secondary,
.btn-light {
  background: #fff;
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.form-control,
.form-select,
.form-check-input,
.select2-container--default .select2-selection--single {
  border-radius: 12px !important;
  border-color: var(--border-light) !important;
  min-height: 44px;
  font-size: 0.9rem;
  box-shadow: none !important;
}
.form-control,
.form-select {
  background-color: #fff;
  color: var(--text-primary);
}
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: rgba(214, 33, 140, 0.45) !important;
  box-shadow: 0 0 0 4px rgba(214, 33, 140, 0.08) !important;
}
.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.nav-tabs {
  border-bottom-color: var(--border-light);
}
.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
}
.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(214, 33, 140, 0.03);
}
.table thead th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom-color: var(--border-light);
}
.table td {
  color: var(--text-primary);
  border-bottom-color: rgba(229, 231, 235, 0.85);
}

.stats-card,
.analytics-card,
.cargo-card,
.role-card,
.admin-card {
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.page-intro,
.page-subtitle,
.panel-subtitle,
.analytics-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Chart container */
.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

/* ===== Dashboard Command Center ===== */
.dashboard-shell {
  padding-bottom: 3rem;
}

.dashboard-shell h1,
.dashboard-shell h2,
.dashboard-shell h3,
.dashboard-shell h4,
.dashboard-shell h5,
.dashboard-shell h6 {
  letter-spacing: 0;
}

.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.25rem 0 1.35rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
}

.dashboard-hero-copy {
  max-width: 760px;
  min-width: 0;
}

.dashboard-eyebrow,
.dashboard-panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dashboard-hero h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.85rem, 2.8vw, 2.8rem);
  font-weight: 850;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 690px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.dashboard-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.dashboard-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.dashboard-kpi-card {
  position: relative;
  min-height: 176px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}

.dashboard-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
}

.dashboard-kpi-card.accent-finance::before { background: #16a34a; }
.dashboard-kpi-card.accent-orders::before { background: #2563eb; }
.dashboard-kpi-card.accent-users::before { background: #d6218c; }
.dashboard-kpi-card.accent-products::before { background: #f59e0b; }

.dashboard-kpi-topline,
.dashboard-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.dashboard-kpi-topline span {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-kpi-topline i {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 1.05rem;
}

.dashboard-kpi-value {
  margin: 0.7rem 0 0.6rem;
  color: var(--text-primary);
  font-size: clamp(1.85rem, 3vw, 2.55rem);
  font-weight: 850;
  line-height: 1.05;
  word-break: break-word;
}

.dashboard-kpi-foot,
.dashboard-chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dashboard-kpi-foot .pill,
.dashboard-chip-row .pill {
  margin: 0;
}

.dashboard-panel {
  min-height: 100%;
  padding: 1.1rem;
}

.dashboard-panel-header {
  align-items: center;
  margin-bottom: 1rem;
}

.dashboard-panel-header h2 {
  margin: 0.1rem 0 0;
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: 0;
}

.dashboard-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-count-pill {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-weight: 850;
  font-size: 0.86rem;
}

.dashboard-chart-wrap {
  position: relative;
  height: 255px;
  min-height: 255px;
}

.dashboard-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.dashboard-status-chip,
.dashboard-attention-item,
.dashboard-order-item,
.dashboard-mini-row,
.dashboard-shortcut,
.dashboard-metric-stack > div {
  border: 1px solid rgba(229, 231, 235, 0.9);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 12px;
}

.dashboard-status-chip {
  padding: 0.75rem;
  min-width: 0;
}

.dashboard-status-chip span,
.dashboard-mini-row span,
.dashboard-metric-stack span,
.dashboard-shop-summary span,
.dashboard-shortcut span {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.dashboard-status-chip strong,
.dashboard-mini-row strong,
.dashboard-metric-stack strong,
.dashboard-shop-summary strong,
.dashboard-shortcut strong {
  display: block;
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.2;
}

.dashboard-attention-list,
.dashboard-order-list,
.dashboard-mini-list,
.dashboard-metric-stack {
  display: grid;
  gap: 0.65rem;
}

.dashboard-attention-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem;
  color: inherit;
  text-decoration: none;
}

.dashboard-attention-item:hover,
.dashboard-shortcut:hover {
  border-color: rgba(214, 33, 140, 0.26);
  color: inherit;
  transform: translateY(-1px);
}

.dashboard-attention-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(214, 33, 140, 0.08);
  color: var(--primary);
  flex: 0 0 38px;
}

.dashboard-attention-copy {
  min-width: 0;
}

.dashboard-attention-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-attention-copy span {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-attention-value {
  min-width: 2.2rem;
  text-align: right;
  color: var(--text-primary);
  font-weight: 850;
}

.dashboard-order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.82rem;
  text-decoration: none;
  color: inherit;
}

.dashboard-order-main {
  min-width: 0;
}

.dashboard-order-main strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-order-main span,
.dashboard-order-side span {
  display: block;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.dashboard-order-side {
  text-align: right;
}

.dashboard-order-side strong {
  display: block;
  color: var(--text-primary);
  font-weight: 850;
}

.dashboard-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 1.55rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-status.is-success { background: rgba(22, 163, 74, 0.1); color: #15803d; }
.dashboard-status.is-warning { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.dashboard-status.is-info { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; }
.dashboard-status.is-danger { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }

.dashboard-shop-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.dashboard-shop-summary > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.dashboard-shop-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--gray-100);
}

.dashboard-shop-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.25s ease;
}

.dashboard-chip-row {
  margin-bottom: 0.8rem;
}

.dashboard-mini-row,
.dashboard-metric-stack > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.76rem 0.82rem;
}

.dashboard-shortcut-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.58rem;
}

.dashboard-shortcut {
  min-height: 56px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.68rem;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.dashboard-shortcut i {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--primary);
}

.dashboard-shortcut span {
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-shortcut strong {
  min-width: 1.8rem;
  text-align: right;
}

.dashboard-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 1rem;
  border: 1px dashed var(--border-light);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

/* ===== Global Admin Search ===== */
.global-search-panel {
  position: sticky;
  top: var(--topbar-height);
  z-index: 45;
  margin: 0 1.5rem;
  padding: 1rem;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 45px rgba(17, 24, 39, 0.1);
  backdrop-filter: blur(12px);
}

.global-search-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.global-search-header h2 {
  margin: 0.1rem 0 0;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0;
}

.global-search-kicker {
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.global-search-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.global-search-scope span {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(214, 33, 140, 0.12);
  border-radius: 999px;
  background: rgba(214, 33, 140, 0.06);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
}

.global-search-status {
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.global-search-status.is-error {
  color: #b91c1c;
}

.global-search-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  max-height: min(58vh, 620px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.global-search-group {
  min-width: 0;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 14px;
  background: rgba(249, 250, 251, 0.72);
  overflow: hidden;
}

.global-search-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  background: #fff;
}

.global-search-group-head strong {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 850;
}

.global-search-group-head span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.global-search-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 62px;
  padding: 0.72rem 0.85rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(229, 231, 235, 0.72);
}

.global-search-item:last-child {
  border-bottom: 0;
}

.global-search-item:hover {
  color: inherit;
  background: rgba(214, 33, 140, 0.04);
}

.global-search-item-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--primary);
}

.global-search-item-main {
  min-width: 0;
}

.global-search-item-main strong,
.global-search-item-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-item-main strong {
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 850;
}

.global-search-item-main span {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.global-search-item-badge {
  max-width: 120px;
  overflow: hidden;
  padding: 0.24rem 0.54rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.06);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-empty {
  grid-column: 1 / -1;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 1px dashed var(--border-light);
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-align: center;
}

/* Mobile Overlay & Responsive */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}
.mobile-overlay.show {
  display: block;
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }

  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .floating-chat-launcher {
    right: 18px;
    bottom: 18px;
    width: 58px;
    height: 58px;
  }
  .main-content {
    margin-left: 0 !important;
  }

  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  .top-bar {
    padding: 0.85rem 1rem;
    align-items: stretch;
    gap: 0.75rem;
  }

  .top-bar > * {
    min-width: 0;
  }

  .search-bar {
    max-width: 100%;
    width: 100%;
  }

  .top-actions,
  .top-bar .d-flex.gap-2,
  .top-bar .d-flex.gap-3 {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem !important;
  }

  .top-actions .btn,
  .top-actions a,
  .top-bar .d-flex.gap-2 .btn,
  .top-bar .d-flex.gap-2 a {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    justify-content: center;
  }

  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 0.25rem;
    padding-bottom: 2px;
  }

  .nav-tabs .nav-link {
    white-space: nowrap;
  }

  .row > [class*="col-"] {
    min-width: 0;
  }

  .card {
    border-radius: 14px;
  }

  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 1rem;
  }

  .dashboard-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-hero-actions .btn {
    flex: 1 1 calc(50% - 0.55rem);
    min-width: 0;
  }

  .dashboard-kpi-card {
    min-height: 158px;
  }

  .dashboard-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-panel {
    padding: 0.95rem;
  }

  .dashboard-chart-wrap {
    height: 220px;
    min-height: 220px;
  }

  .dashboard-attention-item {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .global-search-panel {
    top: auto;
    margin: 0 1rem;
  }

  .global-search-results {
    grid-template-columns: 1fr;
    max-height: 62vh;
  }

  .card-body,
  .card-header {
    min-width: 0;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .card table,
  .card .table {
    min-width: 680px;
  }

  .modal-dialog {
    margin: 0.75rem;
  }

  .modal-content {
    border-radius: 18px;
  }
}

@media (max-width: 576px) {
  .top-actions .btn,
  .top-actions a,
  .top-bar .d-flex.gap-2 .btn,
  .top-bar .d-flex.gap-2 a {
    flex: 1 1 100%;
  }

  .dashboard-hero-actions .btn,
  .dashboard-status-strip {
    flex-basis: 100%;
    grid-template-columns: 1fr;
  }

  .dashboard-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-panel-header .btn {
    width: 100%;
    justify-content: center;
  }

  .dashboard-order-item,
  .dashboard-mini-row,
  .dashboard-metric-stack > div {
    grid-template-columns: 1fr;
  }

  .dashboard-mini-row,
  .dashboard-metric-stack > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .global-search-panel {
    margin: 0 0.75rem;
    padding: 0.85rem;
  }

  .global-search-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .global-search-item-badge {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  display: none;
}
.toast.show {
  display: block;
  animation: fadeInUp 0.3s, fadeOutDown 0.3s 2.7s;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes fadeOutDown {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, 20px); }
}
