/* ==========================================================================
   ORVEXA AI PRODUCTION COMMAND CENTER - DESIGN SYSTEM & STYLES
   ========================================================================== */

:root {
  /* Surfaces & Backgrounds */
  --bg-surface: #f8f9fa;
  --bg-surface-subtle: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  
  /* Borders */
  --border-color: #e5e7eb;
  --border-subtle: #f1f5f9;
  --border-focus: #93c5fd;

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

  /* Brand Accents */
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --primary-blue-subtle: #eff6ff;
  --primary-blue-border: #bfdbfe;

  /* Status Colors */
  --status-success: #10b981;
  --status-success-subtle: #ecfdf5;
  --status-success-border: #a7f3d0;

  --status-info: #0ea5e9;
  --status-info-subtle: #f0f9ff;
  --status-info-border: #bae6fd;

  --status-warning: #f59e0b;
  --status-warning-subtle: #fffbeb;
  --status-warning-border: #fde68a;

  --status-danger: #ef4444;
  --status-danger-subtle: #fef2f2;
  --status-danger-border: #fecaca;

  --status-purple: #8b5cf6;
  --status-purple-subtle: #f5f3ff;
  --status-purple-border: #ddd6fe;

  /* Sidebar Settings (Default Pearl) */
  --sidebar-width: 260px;
  --sidebar-compact-width: 76px;
  --header-height: 64px;
  --card-radius: 12px;
  --badge-radius: 6px;
  
  --sidebar-bg: #ffffff;
  --sidebar-border: #e5e7eb;
  --sidebar-text: #334155;
  --sidebar-text-muted: #94a3b8;
  --sidebar-item-active-bg: #eff6ff;
  --sidebar-item-active-text: #2563eb;
  --sidebar-item-hover-bg: #f8fafc;
}

/* Warm Sidebar Theme */
[data-sidebar-theme="warm"] {
  --sidebar-bg: #fcfbf9;
  --sidebar-border: #eae6df;
  --sidebar-text: #3b3936;
  --sidebar-text-muted: #8c887f;
  --sidebar-item-active-bg: #f3efe6;
  --sidebar-item-active-text: #1e3a8a;
  --sidebar-item-hover-bg: #f7f4ed;
}

/* Dark Sidebar Theme */
[data-sidebar-theme="dark"] {
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-text-muted: #64748b;
  --sidebar-item-active-bg: #1e293b;
  --sidebar-item-active-text: #60a5fa;
  --sidebar-item-hover-bg: #172033;
}

/* Global resets & typography */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-surface);
  color: var(--text-body);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Monospace font */
.font-mono,
code,
pre,
.metric-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: var(--primary-blue-hover);
}

/* Layout container */
#app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

/* Custom scrollbar for sidebar */
#sidebar::-webkit-scrollbar {
  width: 4px;
}
#sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
}

/* Brand Header in Sidebar */
.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-border);
  gap: 12px;
  flex-shrink: 0;
}

.brand-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  overflow: hidden;
}

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

[data-sidebar-theme="dark"] .brand-title {
  color: #ffffff;
}

.brand-subtitle {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
}

/* Sidebar Navigation Items */
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  padding: 12px 10px 6px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 3px;
  white-space: nowrap;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-item-link i {
  font-size: 1.2rem;
  color: var(--sidebar-text-muted);
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.nav-item-link:hover {
  background-color: var(--sidebar-item-hover-bg);
  color: var(--text-main);
}

[data-sidebar-theme="dark"] .nav-item-link:hover {
  color: #ffffff;
}

.nav-item-link:hover i {
  color: var(--primary-blue);
}

.nav-item-link.active {
  background-color: var(--sidebar-item-active-bg);
  color: var(--sidebar-item-active-text);
  font-weight: 600;
}

.nav-item-link.active i {
  color: var(--sidebar-item-active-text);
}

.nav-item-link .badge-nav {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--status-success);
  background-color: var(--status-success-subtle);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--status-success-border);
  white-space: nowrap;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

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

/* COMPACT SIDEBAR STATE */
body.sidebar-compact #sidebar {
  width: var(--sidebar-compact-width);
  min-width: var(--sidebar-compact-width);
}

body.sidebar-compact .brand-info,
body.sidebar-compact .nav-section-title,
body.sidebar-compact .nav-item-title,
body.sidebar-compact .badge-nav,
body.sidebar-compact .system-status-pill span {
  display: none !important;
}

body.sidebar-compact .nav-item-link {
  justify-content: center;
  padding: 10px 0;
}

body.sidebar-compact .nav-item-link i {
  font-size: 1.3rem;
  margin: 0;
}

body.sidebar-compact .sidebar-brand {
  justify-content: center;
  padding: 0;
}

body.sidebar-compact .sidebar-footer {
  justify-content: center;
  padding: 12px 6px;
}

/* EXPAND-ON-HOVER BEHAVIOR FOR COMPACT SIDEBAR */
body.sidebar-compact.sidebar-hover-expand #sidebar:hover {
  width: var(--sidebar-width);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
}

body.sidebar-compact.sidebar-hover-expand #sidebar:hover .brand-info,
body.sidebar-compact.sidebar-hover-expand #sidebar:hover .nav-section-title,
body.sidebar-compact.sidebar-hover-expand #sidebar:hover .nav-item-title,
body.sidebar-compact.sidebar-hover-expand #sidebar:hover .badge-nav,
body.sidebar-compact.sidebar-hover-expand #sidebar:hover .system-status-pill span {
  display: block !important;
}

body.sidebar-compact.sidebar-hover-expand #sidebar:hover .nav-item-link {
  justify-content: flex-start;
  padding: 8px 12px;
}

body.sidebar-compact.sidebar-hover-expand #sidebar:hover .sidebar-brand {
  justify-content: flex-start;
  padding: 0 20px;
}

body.sidebar-compact.sidebar-hover-expand #sidebar:hover .sidebar-footer {
  justify-content: space-between;
  padding: 14px 16px;
}

/* ==========================================================================
   MAIN CONTENT WRAPPER & HEADER
   ========================================================================== */

#content-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-compact #content-wrapper {
  margin-left: var(--sidebar-compact-width);
}

/* GLOBAL HEADER */
#header {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Search Trigger in Header */
.global-search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 6px 16px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  width: 320px;
  max-width: 100%;
  transition: all 0.15s ease;
}

.global-search-btn:hover {
  background-color: #ffffff;
  border-color: var(--border-focus);
  color: var(--text-body);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.kbd-shortcut {
  margin-left: auto;
  font-size: 0.6875rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  color: var(--text-light);
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-ask-ai {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  color: var(--primary-blue);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ask-ai:hover {
  background: linear-gradient(135deg, #dbeafe, #dcfce7);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

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

.icon-btn:hover {
  background-color: var(--bg-surface);
  border-color: #cbd5e1;
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-danger);
  border: 1.5px solid #ffffff;
}

/* User Profile in Header */
.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

.user-profile-btn:hover {
  background-color: var(--bg-surface);
}

.avatar-wrapper {
  position: relative;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.avatar-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--status-success);
  border: 1.5px solid #ffffff;
}

.user-meta-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.user-meta-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Main Container Area */
.main-content {
  padding: 24px 28px;
  flex: 1;
  min-width: 0;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.25;
}

.page-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 0;
  line-height: 1.4;
}

/* ==========================================================================
   CARDS & METRIC WIDGETS
   ========================================================================== */

.orv-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.01);
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Clean grid gutters: cards inside column wrappers don't double bottom margin */
.row > [class*="col-"] > .orv-card {
  margin-bottom: 0;
}

.orv-card:hover {
  border-color: #cbd5e1;
}

.orv-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.orv-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.orv-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Uppercase small label */
.text-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}

/* Metric / Stat Card */
.stat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 128px;
}

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.stat-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background-color: var(--bg-surface);
  color: var(--primary-blue);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.15;
  margin: 4px 0 6px;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.trend-badge.trend-up {
  background-color: var(--status-success-subtle);
  color: var(--status-success);
}

.trend-badge.trend-down {
  background-color: var(--status-danger-subtle);
  color: var(--status-danger);
}

.trend-badge.trend-neutral {
  background-color: var(--bg-surface);
  color: var(--text-muted);
}

/* ==========================================================================
   STATUS BADGES & INDICATORS
   ========================================================================== */

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success {
  background-color: var(--status-success-subtle);
  color: #065f46;
  border: 1px solid var(--status-success-border);
}
.badge-success .status-dot {
  background-color: var(--status-success);
}

.badge-info {
  background-color: var(--status-info-subtle);
  color: #0369a1;
  border: 1px solid var(--status-info-border);
}
.badge-info .status-dot {
  background-color: var(--status-info);
}

.badge-warning {
  background-color: var(--status-warning-subtle);
  color: #92400e;
  border: 1px solid var(--status-warning-border);
}
.badge-warning .status-dot {
  background-color: var(--status-warning);
}

.badge-danger {
  background-color: var(--status-danger-subtle);
  color: #991b1b;
  border: 1px solid var(--status-danger-border);
}
.badge-danger .status-dot {
  background-color: var(--status-danger);
}

.badge-purple {
  background-color: var(--status-purple-subtle);
  color: #5b21b6;
  border: 1px solid var(--status-purple-border);
}
.badge-purple .status-dot {
  background-color: var(--status-purple);
}

.badge-secondary {
  background-color: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.badge-secondary .status-dot {
  background-color: var(--text-light);
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-responsive {
  margin: 0;
  border-radius: 8px;
}

.orv-table {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-body);
  border-collapse: separate;
  border-spacing: 0;
}

.orv-table th {
  background-color: #fafbfc;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  border-top: none;
  white-space: nowrap;
}

.orv-table td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  background-color: #ffffff;
  transition: background-color 0.1s ease;
}

.orv-table tr:last-child td {
  border-bottom: none;
}

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

/* ==========================================================================
   BUTTONS & FORM CONTROLS
   ========================================================================== */

.btn-orv-primary {
  background-color: var(--primary-blue);
  color: #ffffff;
  border: 1px solid var(--primary-blue);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 7px 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-orv-primary:hover {
  background-color: var(--primary-blue-hover);
  border-color: var(--primary-blue-hover);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-orv-secondary {
  background-color: #ffffff;
  color: var(--text-body);
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 7px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-orv-secondary:hover {
  background-color: var(--bg-surface);
  border-color: #cbd5e1;
  color: var(--text-main);
}

.form-control-orv,
.form-select-orv {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.8125rem;
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control-orv:focus,
.form-select-orv:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   COMMAND PALETTE MODAL
   ========================================================================== */

.cmd-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1080;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.cmd-backdrop.show {
  display: flex;
}

.cmd-dialog {
  width: 600px;
  max-width: 90vw;
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cmdSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmdSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cmd-search-wrapper {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.cmd-search-input {
  flex: 1;
  border: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  background: transparent;
}

.cmd-search-input::placeholder {
  color: var(--text-light);
}

.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-category-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-body);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: background-color 0.1s ease;
}

.cmd-item:hover,
.cmd-item.selected {
  background-color: var(--primary-blue-subtle);
  color: var(--primary-blue);
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmd-item i {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.cmd-item:hover i,
.cmd-item.selected i {
  color: var(--primary-blue);
}

.cmd-footer {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ASK AI OFF-CANVAS DRAWER
   ========================================================================== */

.ask-ai-drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: 460px;
  max-width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 1070;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ask-ai-drawer.show {
  right: 0;
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-suggestion-chip {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--text-body);
  cursor: pointer;
  display: inline-block;
  margin-right: 6px;
  margin-bottom: 6px;
  transition: all 0.15s ease;
}

.ai-suggestion-chip:hover {
  background-color: var(--primary-blue-subtle);
  border-color: var(--primary-blue-border);
  color: var(--primary-blue);
}

.chat-bubble {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 90%;
}

.chat-bubble-user {
  background-color: var(--primary-blue);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-bubble-ai {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-body);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background-color: #fafbfc;
}

/* ==========================================================================
   LAYOUT SETTINGS DRAWER / MODAL
   ========================================================================== */

.settings-drawer {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 1070;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-drawer.show {
  right: 0;
}

/* Color theme radio buttons */
.color-choice-card {
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
  margin-bottom: 8px;
}

.color-choice-card:hover {
  border-color: #94a3b8;
}

.color-choice-card.active {
  border-color: var(--primary-blue);
  background-color: var(--primary-blue-subtle);
}

.color-dot-preview {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
}

/* Floating settings trigger button */
.btn-floating-settings {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--text-main);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1030;
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

.btn-floating-settings:hover {
  transform: rotate(45deg);
  background-color: var(--primary-blue);
}

/* ==========================================================================
   DROPDOWNS & OVERLAYS
   ========================================================================== */

.dropdown-menu {
  border-radius: 10px !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
  z-index: 1060;
  margin-top: 6px !important;
}

.dropdown-item {
  font-size: 0.8125rem;
  color: var(--text-body);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  transition: background-color 0.12s ease;
}

.dropdown-item:hover {
  background-color: var(--primary-blue-subtle);
  color: var(--primary-blue);
}

.dropdown-item.text-danger:hover {
  background-color: var(--status-danger-subtle);
  color: var(--status-danger);
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1035;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   CUSTOM CHARTS STYLES
   ========================================================================== */

.chart-container,
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 260px;
}

.chart-container-sm,
.chart-wrapper-sm {
  height: 200px;
}

.chart-container-lg,
.chart-wrapper-lg {
  height: 320px;
}

.chart-container canvas,
.chart-wrapper canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN ADJUSTMENTS
   ========================================================================== */

@media (max-width: 991.98px) {
  #sidebar {
    transform: translateX(-100%);
    width: 260px !important;
  }

  #sidebar.mobile-show {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  #content-wrapper {
    margin-left: 0 !important;
  }

  .global-search-btn {
    width: 220px;
  }

  .user-meta-name,
  .user-meta-role {
    display: none;
  }
}

@media (max-width: 767.98px) {
  #header {
    padding: 0 16px;
    height: 60px;
  }

  .main-content {
    padding: 16px 14px;
  }

  .global-search-btn {
    width: 150px;
    padding: 6px 10px;
  }

  .global-search-btn span:first-child {
    display: none;
  }

  .kbd-shortcut {
    display: none;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .page-title {
    font-size: 1.2rem;
  }

  .btn-ask-ai span {
    display: none;
  }

  .btn-ask-ai {
    padding: 6px 10px;
    border-radius: 8px;
  }

  .ask-ai-drawer {
    width: 100vw;
  }

  .cmd-dialog {
    width: 95vw;
    margin-top: -20px;
  }
}

@media (max-width: 575.98px) {
  .global-search-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
  }

  .global-search-btn span {
    display: none !important;
  }

  .orv-card {
    padding: 16px;
  }

  .stat-card {
    padding: 16px;
  }
}
