/**
 * BHYT Counter App - Modern GovTech & Healthcare Enterprise Design System
 * Inspired by modern clinical & financial web applications (Stripe, Linear, Shadcn UI)
 */

:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Surfaces & Canvas */
  --color-canvas: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;
  --color-surface-subtle: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-subtle: #edf2f7;

  /* Medical Trust Primary Palette */
  --color-primary: #0284c7;
  --color-primary-hover: #0369a1;
  --color-primary-active: #075985;
  --color-primary-light: #f0f9ff;
  --color-primary-border: #bae6fd;

  /* Typography Colors */
  --color-text-main: #0f172a;
  --color-text-body: #334155;
  --color-text-muted: #64748b;
  --color-text-subtle: #94a3b8;

  /* Semantic Status Colors (Soft pastel background, high-contrast dark text) */
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-text: #065f46;
  --color-success-border: #a7f3d0;

  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-warning-text: #92400e;
  --color-warning-border: #fde68a;

  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-danger-text: #991b1b;
  --color-danger-border: #fecaca;

  --color-info: #0284c7;
  --color-info-bg: #f0f9ff;
  --color-info-text: #075985;
  --color-info-border: #bae6fd;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Shadows (Multi-layer diffused shadows) */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Touch accessibility */
  --touch-target: 44px;
  --touch-target-lg: 52px;
}

/* ========================================================================= */
/* BASE & TYPOGRAPHY                                                         */
/* ========================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--color-canvas);
  color: var(--color-text-body);
  font-size: 0.925rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.font-mono, .font-monospace {
  font-family: var(--font-mono) !important;
}

/* ========================================================================= */
/* GLASSMORPHIC NAVBAR & BRANDING                                            */
/* ========================================================================= */
.counter-navbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.65rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.counter-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.counter-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.28);
}

.counter-brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.counter-brand-title .brand-accent {
  color: var(--color-primary);
}

.counter-brand-sub {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Điểm thu pill */
.point-pill {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  color: var(--color-text-main);
}

.badge-code {
  background: #e2e8f0;
  color: #475569;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.7rem;
}

/* Status Pill in Header (Thay thế banner xanh choáng chỗ) */
.portal-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.portal-status-badge.online {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border-color: var(--color-success-border);
}

.portal-status-badge.maintenance {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border-color: var(--color-warning-border);
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  position: relative;
}

.status-pulse-dot.success {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: pulseSuccess 2s infinite;
}

.status-pulse-dot.warning {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

@keyframes pulseSuccess {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Nav Segmented Controls */
.nav-segmented-group {
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  gap: 2px;
}

.counter-nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.counter-nav-link:hover {
  color: var(--color-text-main);
  background: rgba(255, 255, 255, 0.6);
}

.counter-nav-link.active {
  color: var(--color-primary);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Nút Tiếp nhận mới Nổi Bật (CTA) */
.btn-counter-cta {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.48rem 0.95rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.28);
  transition: all 0.15s ease;
  border: none;
}

.btn-counter-cta:hover {
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.38);
  transform: translateY(-1px);
}

.hotkey-tag {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* User actions */
.badge-role {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.badge-role.superuser { background: #fee2e2; color: #b91c1c; }
.badge-role.staff { background: #e0f2fe; color: #0369a1; }

.btn-icon-action {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-action:hover {
  background: #f8fafc;
  color: var(--color-text-main);
  border-color: #cbd5e1;
}

.btn-icon-action.danger:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* ========================================================================= */
/* SUB-BAR (BREADCRUMB & CA LÀM VIỆC)                                       */
/* ========================================================================= */
.counter-subbar {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  padding: 0.45rem 0;
  font-size: 0.8rem;
}

.counter-breadcrumbs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.counter-breadcrumbs li {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
}

.counter-breadcrumbs li a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.counter-breadcrumbs li a:hover {
  color: var(--color-primary);
}

.counter-breadcrumbs li::after {
  content: "/";
  margin-left: 0.4rem;
  color: #cbd5e1;
}

.counter-breadcrumbs li:last-child::after {
  content: "";
}

.counter-breadcrumbs li.active {
  color: var(--color-text-main);
  font-weight: 600;
}

/* ========================================================================= */
/* CARDS & CONTAINERS                                                        */
/* ========================================================================= */
.card-custom {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-custom:hover {
  box-shadow: var(--shadow-md);
}

.card-custom.border-primary {
  border-color: #bae6fd !important;
}

/* ========================================================================= */
/* WORKFLOW STEPPER (CLEAN CONNECTED PROGRESS)                              */
/* ========================================================================= */
.workflow-stepper {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--color-text-muted);
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: #f1f5f9;
  color: #64748b;
  border: 2px solid #e2e8f0;
}

.step-item.active .step-circle {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.step-item.active {
  color: var(--color-primary);
}

.step-item.completed .step-circle {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.step-divider {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 1rem;
}

/* ========================================================================= */
/* QUICK TABS (SEGMENTED TABS)                                               */
/* ========================================================================= */
.quick-tabs-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  background: #ffffff;
  padding: 0.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.quick-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.quick-tab-btn:hover {
  background: #f1f5f9;
  color: var(--color-text-main);
}

.quick-tab-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.quick-tab-badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.quick-tab-btn.active .quick-tab-badge {
  background: var(--color-primary);
  color: #ffffff;
}

/* ========================================================================= */
/* TABLES & STATUS BADGES                                                    */
/* ========================================================================= */
.table {
  border-color: var(--color-border);
}

.table thead th {
  background: #f8fafc;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border-subtle);
}

.table-hover tbody tr:hover {
  background-color: #f8fafc;
}

/* Pill Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge.bg-success, .badge-status.approved {
  background: var(--color-success-bg) !important;
  color: var(--color-success-text) !important;
  border-color: var(--color-success-border) !important;
}

.badge.bg-warning, .badge-status.pending {
  background: var(--color-warning-bg) !important;
  color: var(--color-warning-text) !important;
  border-color: var(--color-warning-border) !important;
}

.badge.bg-danger, .badge-status.correction {
  background: var(--color-danger-bg) !important;
  color: var(--color-danger-text) !important;
  border-color: var(--color-danger-border) !important;
}

.badge.bg-primary, .badge.bg-info, .badge-status.ready {
  background: var(--color-primary-light) !important;
  color: var(--color-primary) !important;
  border-color: var(--color-primary-border) !important;
}

.badge.bg-secondary, .badge-status.draft {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
}

/* ========================================================================= */
/* CCCD SCANNER BOX                                                          */
/* ========================================================================= */
.cccd-scanner-box {
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  background-image: radial-gradient(#e0f2fe 1px, transparent 1px);
  background-size: 16px 16px;
}

/* ========================================================================= */
/* BUTTONS & FORM INPUTS                                                     */
/* ========================================================================= */
.btn {
  font-weight: 600;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.form-control, .form-select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  padding: 0.52rem 0.85rem;
  color: var(--color-text-main);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Kbd tag */
kbd {
  font-family: var(--font-mono);
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.72rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* ========================================================================= */
/* RESPONSIVE & PRINT                                                        */
/* ========================================================================= */
@media (max-width: 768px) {
  .counter-navbar {
    padding: 0.5rem 0;
  }
  .workflow-stepper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .step-divider {
    display: none;
  }
}

@media print {
  .no-print, .counter-navbar, .counter-subbar, .counter-footer {
    display: none !important;
  }
  body {
    background: #ffffff !important;
  }
  .main-content {
    padding: 0 !important;
  }
}

/* ========================================================================= */
/* DIGITAL CCCD SIMULATOR & OMNI SCANNER                                     */
/* ========================================================================= */
.omni-scanner-bar {
  background: #ffffff;
  border: 1.5px solid #0284c7;
  border-radius: 12px;
  box-shadow: 0 4px 14px -2px rgba(2, 132, 199, 0.15);
  transition: all 0.2s ease;
}
.omni-scanner-bar:focus-within {
  border-color: #0369a1;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2);
}

.radar-pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.radar-pulse-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: #10b981;
  border-radius: 50%;
  animation: radar-pulse 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
@keyframes radar-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.8); opacity: 0; }
}

.cccd-card-preview {
  position: relative;
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 50%, #eff6ff 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 8px 20px -4px rgba(2, 132, 199, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.cccd-card-preview::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
  pointer-events: none;
}
.cccd-chip {
  width: 36px;
  height: 26px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border: 1px solid #b45309;
  border-radius: 4px;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.cccd-chip::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  right: 5px;
  bottom: 3px;
  border: 1px dashed rgba(0, 0, 0, 0.25);
  border-radius: 2px;
}
.cccd-avatar-placeholder {
  width: 65px;
  height: 80px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.65rem;
  flex-shrink: 0;
}
.hotkey-badge {
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-family: var(--font-mono);
}


/* ==========================================================================
   HƯỚNG 4: UNIFIED BHYT WORKSPACE (APP SHELL, ADAPTIVE SIDEBAR & COMMAND PALETTE)
   ========================================================================== */

/* Main Workspace Flex Wrapper */
.workspace-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: #f8fafc;
  width: 100%;
  overflow-x: hidden;
}

/* Sidebar Styling */
.workspace-sidebar {
  width: 270px;
  min-width: 270px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1040;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease;
  user-select: none;
}

/* Header inside sidebar */
.sidebar-header {
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  color: inherit;
}

.brand-shield-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
  flex-shrink: 0;
}

.brand-info {
  white-space: nowrap;
}

.brand-title {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: #0f172a;
  line-height: 1.2;
}

.brand-accent {
  color: #0284c7;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
}

.btn-sidebar-collapse {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sidebar-collapse:hover {
  background: #f1f5f9;
  color: #0284c7;
  border-color: #cbd5e1;
}

/* User Context in Sidebar */
.sidebar-user-context {
  padding: 0.75rem 1rem;
  margin: 0.75rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.context-point-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.context-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
}

.role-pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 100px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.role-pill-badge.role-admin {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.role-pill-badge.role-cashier {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.portal-mini-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #166534;
}

.portal-mini-status.warning {
  color: #b45309;
}

/* Scrollable Nav Area */
.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.65rem;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0.65rem 0.75rem 0.35rem;
  text-transform: uppercase;
}

.nav-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: #334155;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
  margin-bottom: 2px;
}

.nav-link-item:hover {
  background: #f1f5f9;
  color: #0284c7;
}

.nav-link-item.active {
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 600;
}

.nav-link-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #0284c7;
}

.nav-link-item.action-highlight {
  background: #f0fdf4;
  color: #15803d;
  border: 1px dashed #bbf7d0;
}

.nav-link-item.action-highlight:hover {
  background: #dcfce7;
  color: #166534;
}

.nav-link-item.superuser-link {
  color: #7c3aed;
}

.nav-link-item.superuser-link:hover {
  background: #f5f3ff;
  color: #6d28d9;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #64748b;
  transition: color 0.15s ease;
}

.nav-link-item:hover .nav-icon,
.nav-link-item.active .nav-icon {
  color: #0284c7;
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-hotkey {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 1px 5px;
  border-radius: 4px;
  color: #64748b;
}

.sidebar-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  line-height: 1;
}

.sidebar-badge.badge-warning {
  background: #fef3c7;
  color: #b45309;
}

.sidebar-badge.badge-danger {
  background: #fee2e2;
  color: #dc2626;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.75rem 0.85rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.footer-user-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-text-meta {
  min-width: 0;
  flex: 1;
}

.user-display-name {
  font-size: 0.82rem;
  color: #0f172a;
}

.user-role-label {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
}

.btn-logout-sidebar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout-sidebar:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Collapsed Mini-Sidebar State */
.workspace-sidebar.collapsed {
  width: 72px;
  min-width: 72px;
}

.workspace-sidebar.collapsed .brand-info,
.workspace-sidebar.collapsed .sidebar-user-context,
.workspace-sidebar.collapsed .nav-section-label,
.workspace-sidebar.collapsed .nav-text,
.workspace-sidebar.collapsed .sidebar-hotkey,
.workspace-sidebar.collapsed .sidebar-badge,
.workspace-sidebar.collapsed .user-text-meta {
  display: none !important;
}

.workspace-sidebar.collapsed .sidebar-header {
  padding: 0 0.5rem;
  justify-content: center;
}

.workspace-sidebar.collapsed .sidebar-brand {
  display: none !important;
}

.btn-sidebar-collapse .icon-collapsed {
  display: none;
}
.btn-sidebar-collapse .icon-normal {
  display: inline-block;
}

.workspace-sidebar.collapsed .btn-sidebar-collapse {
  display: flex !important;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0284c7;
  border: 1.5px solid #0284c7;
  font-size: 1.25rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2);
}

.workspace-sidebar.collapsed .btn-sidebar-collapse:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0369a1;
  transform: scale(1.08);
}

.workspace-sidebar.collapsed .btn-sidebar-collapse .icon-normal {
  display: none !important;
}

.workspace-sidebar.collapsed .btn-sidebar-collapse .icon-collapsed {
  display: inline-block !important;
}

.btn-desktop-sidebar-toggle {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-desktop-sidebar-toggle:hover {
  background: #f1f5f9;
  color: #0284c7;
  border-color: #cbd5e1;
}

.workspace-sidebar.collapsed .nav-link-item {
  justify-content: center;
  padding: 0.65rem 0;
}

.workspace-sidebar.collapsed .footer-user-box {
  justify-content: center;
  padding: 0.35rem 0;
  background: transparent;
  border: none;
}

/* Main Workspace Panel */
.workspace-main-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Workspace Unified Topbar */
.workspace-topbar {
  height: 64px;
  min-height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-mobile-sidebar-toggle {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.topbar-search-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  color: #64748b;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 240px;
}

.topbar-search-trigger:hover {
  background: #ffffff;
  border-color: #0284c7;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.status-pill-secure {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
}

/* Command Palette Modal Styling */
.command-palette-content {
  border: 1px solid #e2e8f0 !important;
  background: #ffffff;
}

.command-item {
  transition: all 0.15s ease;
  cursor: pointer;
}

.command-item:hover,
.command-item.selected {
  background-color: #f0f9ff !important;
  transform: translateX(4px);
}

.command-icon-box {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

/* Mobile Sidebar Drawer Overlay */
@media (max-width: 991.98px) {
  .workspace-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .workspace-sidebar.mobile-open {
    transform: translateX(0);
  }

  .workspace-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1035;
    display: none;
    backdrop-filter: blur(2px);
  }

  .workspace-sidebar-backdrop.show {
    display: block;
  }
}
