/* PD RAG - Document Management Interface */
/* Styled with pibiCo Brand Guidelines */

/* Root Container */
.pd-drive-container {
  width: 100%;
  max-width: 100%;
  padding: 0;
  background: var(--bg-color);
  font-family: 'Figtree', Arial, sans-serif;
  color: #4682b4;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;

  /* Flexbox Layout for resizable sections */
  display: flex;
  height: calc(80vh - 30px);
}

/* Collapsed sidebar state */
.pd-drive-container.sidebar-collapsed .pd-sidebar {
  display: none;
}

.pd-drive-container.sidebar-collapsed .pd-resize-handle {
  display: none;
}

/* ===== LEFT SIDEBAR (320px) ===== */
.pd-sidebar {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px 0 0 0;
  border-right: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  width: 320px;
  min-width: 200px;
  max-width: 600px;
  flex-shrink: 0;
}

/* Resize Handle - Seamless vertical divider */
.pd-resize-handle {
  width: 1px;
  background: var(--border-color);
  cursor: col-resize;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease;
  user-select: none;
  margin: 0;
  padding: 0;
}

.pd-resize-handle:hover,
.pd-resize-handle.resizing {
  background: #4682b4;
  width: 2px;
}

.pd-resize-handle::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  right: -3px;
  /* Expanded hit area for easier grabbing */
}

/* Sidebar Header */
.pd-sidebar-header {
  padding: 6px;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.08) 0%, rgba(46, 77, 111, 0.04) 100%);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Raleway', Arial, sans-serif;
  color: var(--text-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-title .fa {
  color: #4682b4;
  font-size: 14px;
}

/* Sidebar Body */
.pd-sidebar-body {
  padding: 6px;
  padding-top: 21px;
  flex: 1;
  overflow-y: auto;
}

/* Workspace Selector - Top Section (like path bar) */
.pd-workspace-selector {
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.04) 0%, rgba(46, 77, 111, 0.02) 100%);
  border-bottom: 1px solid var(--border-color);
  min-height: 52px;
  display: flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

/* Path Bar in Documents Area - Top aligned */
.pd-path-bar {
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.04) 0%, rgba(46, 77, 111, 0.02) 100%);
  border-bottom: 1px solid var(--border-color);
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-path-bar .pd-sidebar-toggle {
  flex-shrink: 0;
}

.pd-path-input-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid rgba(70, 130, 180, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  transition: all 0.2s ease;
  height: 36px;
}

.pd-path-input-container:focus-within {
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.1);
}

.pd-path-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #333;
  font-size: 13px;
  font-family: 'Figtree', Arial, sans-serif;
  padding: 0;
  min-width: 0;
  cursor: text;
}

.pd-path-input::placeholder {
  color: #999;
}

.pd-path-go-btn,
.pd-tree-view-main-btn {
  width: 28px !important;
  height: 28px !important;
  flex-shrink: 0;
}

.pd-path-go-btn .fa,
.pd-tree-view-main-btn .fa {
  font-size: 12px;
}

.pd-path-go-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: 1px solid #4CAF50;
}

.pd-path-go-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.pd-path-separator {
  color: #999;
  font-size: 12px;
  flex-shrink: 0;
  margin: 0 4px;
}

/* Folder List Header (like toolbar) */
.pd-folder-list-header {
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.06) 0%, rgba(46, 77, 111, 0.03) 100%);
  border-bottom: 1px solid rgba(70, 130, 180, 0.15);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
}

.pd-folder-list-header .pd-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4682b4;
  margin: 0;
  padding: 0;
  border: none;
  flex: 1;
}

.pd-tree-view-btn {
  width: 36px !important;
  height: 36px !important;
  flex-shrink: 0;
}

/* Folder Content Area (like main content area) */
.pd-folder-content-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.pd-folder-items {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

/* Folder Item (flat list item) */
.pd-folder-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  margin-bottom: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  color: var(--text-color);
  border: 1px solid transparent;
}

.pd-folder-item:hover {
  background: rgba(70, 130, 180, 0.08);
  border-color: rgba(70, 130, 180, 0.2);
}

.pd-folder-item.active {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.12) 0%, rgba(46, 77, 111, 0.12) 100%);
  border-color: #4682b4;
  font-weight: 600;
}

.pd-folder-item.parent-folder {
  width: 36px;
  height: 36px;
  padding: 0;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.pd-folder-item .fa {
  font-size: 16px;
  color: #4682b4;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}


.pd-folder-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-folder-item-count {
  font-size: 11px;
  font-weight: 700;
  color: white;
  /* Background color set dynamically via JavaScript gradient */
  background: #4682b4; /* Fallback color */
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* New split count badges - normalized design */
.pd-folder-count-badge {
  font-size: 9px;
  font-weight: 700;
  color: white;
  padding: 3px 6px;
  border-radius: 6px;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pd-folder-count-badge i {
  font-size: 8px;
  color: white;
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.3),
    1px -1px 0 rgba(255, 255, 255, 0.3),
    -1px 1px 0 rgba(255, 255, 255, 0.3),
    1px 1px 0 rgba(255, 255, 255, 0.3);
}

/* File badge (gray) */
.pd-file-badge {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  border: 1px solid rgba(108, 117, 125, 0.3);
}

.pd-file-badge:hover {
  background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Data badge (blue) */
.pd-data-badge {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.pd-data-badge:hover {
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

/* Sidebar Sections (Quick Access & Categories) */
.pd-sidebar-section {
  padding: 8px 12px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  flex-shrink: 0;
}

.pd-sidebar-section .pd-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

/* Collapsible Section Header */
.pd-collapsible-header {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  padding: 4px 0;
  border-radius: 4px;
}

.pd-collapsible-header:hover {
  background: rgba(70, 130, 180, 0.05);
}

/* Chevron Toggle Icon */
.pd-section-toggle {
  font-size: 10px;
  color: #4682b4;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.pd-sidebar-section.collapsed .pd-section-toggle {
  transform: rotate(-90deg);
}

/* Collapsible Content */
.pd-collapsible-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
  opacity: 1;
  margin-top: 3px;
}

.pd-sidebar-section.collapsed .pd-collapsible-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.pd-sidebar-section .pd-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #4682b4;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Raleway', Arial, sans-serif;
  border-bottom: none;
  margin: 0;
  padding-bottom: 0;
}

/* Quick Filters in Sidebar - Two Column Grid */
.pd-sidebar-section .pd-quick-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
  overflow: hidden;
}

.pd-sidebar-section .pd-quick-filters .pd-filter-badge {
  position: relative;
  width: 100%;
  justify-content: flex-start;
  padding: 3px 22px 3px 6px; /* Add right padding for badge counter */
  border-radius: 6px;
  font-size: 9px;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
  min-height: 24px; /* Ensure enough height for the badge */
}

.pd-sidebar-section .pd-quick-filters .pd-filter-badge span:not(.pd-badge-count) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  font-size: 9px; /* Ensure consistent text size */
}

.pd-sidebar-section .pd-quick-filters .pd-filter-badge .fa {
  font-size: 10px; /* Consistent icon size */
}

/* Position badge counter in top-right corner for quick access filters */
.pd-sidebar-section .pd-quick-filters .pd-filter-badge .pd-badge-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 1px 3px;
  font-size: 8px;
  line-height: 14px;
  border-radius: 0 4px 0 4px;
  background: rgba(70, 130, 180, 0.85); /* Steel blue */
  color: white;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pd-sidebar-section .pd-quick-filters .pd-filter-badge.active .pd-badge-count {
  background: rgba(70, 130, 180, 1); /* Solid steel blue */
  color: white;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Category Filters in Sidebar - Two Column Grid */
.pd-sidebar-section .pd-category-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
  overflow: hidden;
}

.pd-sidebar-section .pd-category-filters .pd-filter-badge {
  position: relative;
  width: 100%;
  justify-content: flex-start;
  padding: 3px 22px 3px 6px; /* Add right padding for badge counter */
  border-radius: 6px;
  font-size: 9px;
  gap: 3px;
  overflow: hidden; /* Keep contained */
  min-width: 0;
  min-height: 24px; /* Ensure enough height for the badge */
}

.pd-sidebar-section .pd-category-filters .pd-filter-badge .category-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  font-size: 9px; /* Ensure consistent text size */
}

.pd-sidebar-section .pd-category-filters .pd-filter-badge .fa {
  font-size: 10px; /* Consistent icon size */
}

/* Position badge counter in top-right corner for category filters - flush with corner */
.pd-sidebar-section .pd-category-filters .pd-filter-badge .pd-badge-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 1px 3px;
  font-size: 8px;
  line-height: 14px;
  border-radius: 0 4px 0 4px; /* Match parent top-right radius, rounded bottom-left */
  background: rgba(70, 130, 180, 0.85); /* Steel blue */
  color: white;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Active state for category badge counter */
.pd-sidebar-section .pd-category-filters .pd-filter-badge.active .pd-badge-count {
  background: rgba(70, 130, 180, 1); /* Solid steel blue when active */
  color: white;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Tag Filters in Sidebar - Two Column Grid */
.pd-sidebar-section .pd-tag-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
  overflow: hidden;
}

.pd-sidebar-section .pd-tag-filters .pd-filter-badge {
  width: 100%;
  justify-content: flex-start;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 9px;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
}

.pd-sidebar-section .pd-tag-filters .pd-filter-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

/* Filters Section Styles */
.pd-filters-section .pd-filters-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pd-filter-search-group {
  position: relative;
  display: flex;
  align-items: center;
}

.pd-filter-search-group .fa-search {
  position: absolute;
  left: 10px;
  color: #999;
  font-size: 12px;
  pointer-events: none;
}

.pd-filter-search-input {
  width: 100%;
  padding: 8px 8px 8px 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 12px;
  font-family: 'Figtree', Arial, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pd-filter-search-input:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.1);
}

.pd-filter-search-input::placeholder {
  color: #999;
  font-size: 11px;
}

/* Sidebar Filter Search Options */
.pd-filter-search-options {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.pd-filter-search-content-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-color);
  margin: 0;
  user-select: none;
}

.pd-filter-search-content-checkbox {
  cursor: pointer;
  margin: 0;
}

.pd-filter-search-mode-select {
  font-size: 11px;
  padding: 3px 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-color);
  color: var(--text-color);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.pd-filter-search-mode-select:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.1);
}

.pd-filter-search-help-btn {
  background: none;
  border: none;
  color: #4682b4;
  cursor: pointer;
  padding: 3px 6px;
  font-size: 12px;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pd-filter-search-help-btn:hover {
  color: #2e4d6f;
}

.pd-filter-extensions-group {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two column grid like other filters */
  gap: 4px;
  width: 100%;
}

.pd-filter-extensions-group .pd-extensions-badge {
  position: relative;
  width: 100%;
  justify-content: flex-start;
  padding: 3px 22px 3px 6px; /* Add right padding for badge counter */
  border-radius: 4px; /* Match other filter badges */
  font-size: 9px;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
  min-height: 24px;
}

.pd-filter-extensions-group .pd-extensions-badge span:not(.pd-badge-count):not(.pd-extensions-count) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  font-size: 9px; /* Ensure consistent text size */
}

.pd-filter-extensions-group .pd-extensions-badge .fa {
  font-size: 10px; /* Consistent icon size */
}

/* Position badge counter in top-right corner for file types badge */
.pd-filter-extensions-group .pd-extensions-badge .pd-badge-count,
.pd-filter-extensions-group .pd-extensions-badge .pd-extensions-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 1px 3px;
  font-size: 8px;
  line-height: 14px;
  border-radius: 0 4px 0 4px;
  background: rgba(70, 130, 180, 0.85); /* Steel blue */
  color: white;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pd-filter-extensions-group .pd-extensions-badge.active .pd-badge-count,
.pd-filter-extensions-group .pd-extensions-badge.active .pd-extensions-count {
  background: rgba(70, 130, 180, 1); /* Solid steel blue */
  color: white;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.pd-workspace-selector .floating-label {
  position: absolute;
  top: -16px;
  right: 8px;
  color: #4682b4;
  font-size: 12px;
  font-weight: 500;
  background: white;
  padding: 0 6px;
  z-index: 1;
  margin: 0;
  border-radius: 4px;
}

.pd-workspace-selector .floating-label .fa {
  margin-right: 4px;
  color: #4682b4;
  font-size: 11px;
}

.pd-workspace-dropdown {
  width: 100%;
  padding: 6px 12px;
  border: 1px solid rgba(70, 130, 180, 0.3);
  border-radius: 6px;
  background: white;
  color: #333;
  font-size: 13px;
  height: 36px;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Figtree', Arial, sans-serif;
}

.pd-workspace-dropdown:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.1);
}

/* Workspace Menu Dropdown */
.pd-workspace-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  max-height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Search Container */
.pd-workspace-search-container {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.04) 0%, rgba(46, 77, 111, 0.02) 100%);
  flex-shrink: 0;
}

.pd-workspace-search-box {
  position: relative;
  width: 100%;
}

.pd-workspace-search-box .fa {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #4682b4;
  font-size: 11px;
}

.pd-workspace-search-input {
  width: 100%;
  padding: 4px 8px 4px 28px;
  border: 1px solid rgba(70, 130, 180, 0.3);
  border-radius: 6px;
  background: white;
  color: #333;
  font-size: 12px;
  height: 28px;
  line-height: 1.2;
  transition: all 0.2s ease;
  font-family: 'Figtree', Arial, sans-serif;
}

.pd-workspace-search-input:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.1);
}

.pd-workspace-search-input::placeholder {
  color: #999;
}

/* Scrollable Items Container */
.pd-workspace-items-container {
  overflow-y: auto;
  max-height: 280px;
  flex: 1;
}

.pd-workspace-item {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  color: var(--text-color);
  font-family: 'Figtree', Arial, sans-serif;
}

.pd-workspace-item:hover {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.08) 0%, rgba(46, 77, 111, 0.04) 100%);
}

.pd-workspace-item .workspace-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.pd-workspace-item .workspace-icon .icon {
  width: 16px;
  height: 16px;
}

/* Create Library Item */
.pd-create-library-item {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.05) 0%, rgba(46, 77, 111, 0.02) 100%);
  border-top: 1px solid var(--border-color);
  font-weight: 600;
}

.pd-create-library-item:hover {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.12) 0%, rgba(46, 77, 111, 0.08) 100%);
}

.pd-create-library-item .workspace-icon {
  color: #4682b4;
}

.pd-create-library-item .fa-plus {
  font-size: 14px;
}

/* Divider */
.pd-workspace-menu-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-color) 50%, transparent 100%);
  margin: 0;
  flex-shrink: 0;
}

/* Section Titles */
.pd-section-title {
  font-size: 12px;
  font-weight: 600;
  font-family: 'Raleway', Arial, sans-serif;
  color: var(--text-color);
  margin: 16px 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pd-section-title .fa {
  color: #4682b4;
  font-size: 11px;
}

/* Quick Access Navigation */
.pd-nav-item {
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-color);
}

.pd-nav-item:hover {
  background: rgba(70, 130, 180, 0.08);
}

.pd-nav-item.active {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.1) 0%, rgba(46, 77, 111, 0.1) 100%);
  color: #2e4d6f;
  font-weight: 600;
}

.pd-nav-item .fa {
  width: 16px;
  text-align: center;
  font-size: 11px;
  color: #4682b4;
}

.pd-nav-item span:first-of-type {
  flex: 1;
}

.pd-count {
  font-size: 10px;
  font-weight: 700;
  color: #4682b4;
  background: rgba(70, 130, 180, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

/* Folder Tree */
.pd-folder-tree {
  margin-top: 8px;
}

/* Tree Root (Home) Node */
.pd-tree-root {
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-color);
  font-weight: 600;
  background: rgba(70, 130, 180, 0.05);
}

.pd-tree-root:hover {
  background: rgba(70, 130, 180, 0.1);
}

.pd-tree-root.active {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.15) 0%, rgba(46, 77, 111, 0.15) 100%);
  color: #2e4d6f;
}

.pd-tree-root .fa-home {
  color: #4682b4;
  font-size: 12px;
}

/* Tree Items (Folders) */
.pd-tree-item {
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  margin-bottom: 1px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-color);
  position: relative;
  user-select: none;
}

.pd-tree-item:hover {
  background: rgba(70, 130, 180, 0.08);
}

.pd-tree-item.active {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.12) 0%, rgba(46, 77, 111, 0.12) 100%);
  color: #2e4d6f;
  font-weight: 600;
  border-left: 3px solid #4682b4;
  padding-left: 5px;
}

.pd-tree-item .fa-chevron-right,
.pd-tree-item .fa-chevron-down {
  font-size: 9px;
  transition: transform 0.2s ease;
  color: #999;
  width: 12px;
  flex-shrink: 0;
}

.pd-tree-item.expanded .fa-chevron-right {
  transform: rotate(90deg);
}

.pd-tree-item .fa-folder,
.pd-tree-item .fa-folder-open {
  font-size: 12px;
  color: #4682b4;
  flex-shrink: 0;
}

.pd-tree-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-tree-item-count {
  font-size: 10px;
  color: white;
  /* Background color set dynamically via JavaScript gradient */
  background: #4682b4; /* Fallback color */
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Nested folder children */
.pd-tree-children {
  margin-left: 0;
  padding-left: 16px;
  border-left: 1px solid rgba(70, 130, 180, 0.15);
  margin-top: 2px;
  margin-bottom: 2px;
}

/* Root level children (no border) */
.pd-tree-root-children {
  margin-left: 0;
  padding-left: 0;
  margin-top: 4px;
}

/* Category List - 2 Column Grid */
.pd-category-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 4px;
  padding: 0;
  margin: 0;
  width: 100%;
  overflow: hidden;
}

/* Category Filters - Badge Style */
.pd-category-item {
  padding: 0;
  margin-bottom: 0;
  cursor: pointer;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.pd-category-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1.5px solid;
  transition: all 0.2s ease;
  font-size: 10px;
  font-weight: 600;
  color: white !important;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.pd-category-badge i {
  font-size: 10px;
  opacity: 1;
  color: white !important;
  flex-shrink: 0;
}

.pd-category-name {
  flex: 1;
  font-size: 9px;
  font-weight: 700;
  color: white !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Red notification badge for count */
.pd-category-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ff4757 0%, #dc3545 100%);
  color: white;
  font-size: 8px;
  font-weight: bold;
  padding: 1px 4px;
  border-radius: 8px;
  min-width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(220, 53, 69, 0.3), 0 0 0 1.5px white;
  border: 1px solid white;
  line-height: 1;
}

.pd-category-item:hover .pd-category-badge {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pd-category-item.active .pd-category-badge {
  box-shadow: 0 0 0 3px rgba(70, 130, 180, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
}

/* Old styles - keeping for compatibility */
.category-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-label {
  flex: 1;
  font-size: 12px;
}

.category-count {
  font-size: 10px;
  color: #888;
}

/* Sidebar Footer */
.pd-sidebar-footer {
  padding: 6px;
  border-top: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.05) 0%, rgba(46, 77, 111, 0.02) 100%);
}

.pd-storage-status {
  font-size: 11px;
  color: var(--text-muted);
}

.storage-bar {
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
}

.storage-used {
  height: 100%;
  background: linear-gradient(90deg, #4682b4, #2e4d6f);
  transition: width 0.3s ease;
}

.storage-text {
  font-size: 10px;
  color: #888;
  line-height: 1.2;
}

/* ===== MAIN PANEL (flex-grow) ===== */
.pd-main-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 12px 12px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  min-width: 400px;
  margin-left: -1px; /* Overlap the resize handle slightly */
}

/* When sidebar is collapsed, restore left border */
.pd-drive-container.sidebar-collapsed .pd-main-panel {
  border-left: 1px solid var(--border-color);
  border-radius: 12px;
  margin-left: 0;
}

/* Main Panel Header */
.pd-main-header {
  padding: 6px;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.08) 0%, rgba(46, 77, 111, 0.04) 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.main-title {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Raleway', Arial, sans-serif;
  color: var(--text-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.main-title .fa {
  color: #4682b4;
  font-size: 14px;
}

/* Toolbar */
.pd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.02) 0%, rgba(46, 77, 111, 0.01) 100%);
}

.pd-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pd-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  max-width: 400px;
}

.pd-btn {
  padding: 3px 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-color);
  line-height: 1.2;
  min-height: 32px;
  height: 32px;
}

.pd-btn:hover:not(:disabled) {
  background: #2e4d6f;
  color: white;
  border-color: #2e4d6f;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(46, 77, 111, 0.3);
}

.pd-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pd-btn .fa {
  font-size: 11px;
}

.pd-btn-primary {
  background: linear-gradient(135deg, #4682b4 0%, #2e4d6f 100%);
  color: white;
  border: none;
}

.pd-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2e4d6f 0%, rgb(0, 130, 120) 100%);
  box-shadow: 0 4px 12px rgba(70, 130, 180, 0.3);
}

.pd-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: white;
  color: #4682b4;
  border: 1px solid rgba(70, 130, 180, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pd-btn-icon:hover {
  background: #4682b4;
  color: white;
  border-color: #4682b4;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(70, 130, 180, 0.25);
}

.pd-btn-icon.active {
  background: #4682b4;
  color: white;
  border-color: #4682b4;
}

.pd-btn-icon .fa {
  font-size: 14px;
}

/* Primary icon button variant */
.pd-btn-icon.pd-btn-primary {
  background: linear-gradient(135deg, #4682b4 0%, #2e4d6f 100%);
  color: white;
  border: 1px solid #4682b4;
}

.pd-btn-icon.pd-btn-primary:hover {
  background: linear-gradient(135deg, #2e4d6f 0%, #4682b4 100%);
  box-shadow: 0 2px 12px rgba(70, 130, 180, 0.4);
}

/* Sidebar toggle button - special styling */
.pd-sidebar-toggle {
  margin-right: 4px;
}

.pd-sidebar-toggle .fa {
  transition: transform 0.3s ease;
}

.sidebar-collapsed .pd-sidebar-toggle .fa {
  transform: rotate(180deg);
}

/* Smaller add folder button in sidebar */
.pd-add-folder-btn {
  width: auto;
  height: auto;
  min-width: 18px;
  min-height: 18px;
  padding: 2px;
  border-radius: 4px;
  border: 1px solid #4682b4;
}

.pd-add-folder-btn .fa {
  font-size: 11px;
}

.pd-add-folder-btn:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(70, 130, 180, 0.2);
}

/* Search Container - Two Row Layout */
.pd-search-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 350px;
}

/* Search Box - First Row */
.pd-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.pd-search-box .fa {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #4682b4;
  font-size: 11px;
  z-index: 1;
  pointer-events: none;
}

.pd-search-input {
  flex: 1;
  width: 100%;
  padding: 6px 12px 6px 32px;
  border: 1px solid rgba(70, 130, 180, 0.3);
  border-radius: 6px;
  background: white;
  color: #333;
  font-size: 13px;
  height: 36px;
  line-height: 1.2;
  transition: all 0.2s ease;
  font-family: 'Figtree', Arial, sans-serif;
}

.pd-search-input:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.1);
}

/* Search Options - Second Row */
.pd-search-options {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 2px;
  height: 28px; /* Fixed height for alignment */
}

/* Extended Search Checkbox Toggle */
.pd-search-content-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  height: 28px; /* Match parent height */
  line-height: 1;
}

.pd-search-content-toggle:hover {
  background-color: rgba(70, 130, 180, 0.05);
}

.pd-search-content-checkbox {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #4682b4;
  vertical-align: middle;
  flex-shrink: 0;
}

.pd-checkbox-label {
  font-size: 11px;
  color: #666;
  font-weight: 500;
  line-height: 1;
  margin: 0;
  padding: 0;
}

.pd-search-content-toggle input:checked + .pd-checkbox-label {
  color: #4682b4;
  font-weight: 600;
}

/* Search Mode Selector */
.pd-search-mode-select {
  padding: 5px 10px;
  border: 1px solid rgba(70, 130, 180, 0.3);
  border-radius: 4px;
  background: white;
  color: #555;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  height: 28px; /* Match parent height */
  line-height: 1;
  vertical-align: middle;
}

.pd-search-mode-select:hover {
  border-color: #4682b4;
}

.pd-search-mode-select:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.1);
}

/* Note: Visibility controlled by JavaScript event listener on checkbox change */

/* Search Help Button */
.pd-search-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(70, 130, 180, 0.3);
  border-radius: 50%;
  background: white;
  color: #4682b4;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.pd-search-help-btn:hover {
  background: rgba(70, 130, 180, 0.1);
  border-color: #4682b4;
  color: #2c5282;
}

.pd-search-help-btn:active {
  transform: scale(0.95);
}

.pd-search-help-btn i {
  margin: 0;
  line-height: 1;
}

/* Filter Bar - New row for filters and categories */
/* Filter bar removed - filters now in sidebar */

.pd-quick-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pd-category-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.pd-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: white;
  border: 1.5px solid rgba(70, 130, 180, 0.25);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  color: #4682b4;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: 'Figtree', Arial, sans-serif;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-filter-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.pd-filter-badge:hover {
  background: rgba(70, 130, 180, 0.08);
  border-color: #4682b4;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(70, 130, 180, 0.15);
}

.pd-filter-badge.active {
  background: linear-gradient(135deg, #4682b4 0%, #2e4d6f 100%);
  color: white;
  border-color: #4682b4;
  box-shadow: 0 2px 8px rgba(70, 130, 180, 0.3);
}

.pd-filter-badge .fa {
  font-size: 11px;
}

.pd-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: rgba(70, 130, 180, 0.15);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.pd-filter-badge.active .pd-badge-count {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* Category filter badge color variants */
.pd-filter-badge.category-waste {
  border-color: #FF9800;
  color: #E65100;
}

.pd-filter-badge.category-waste.active {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
  border-color: #FF9800;
  color: white;
}

.pd-filter-badge.category-safety {
  border-color: #4CAF50;
  color: #2E7D32;
}

.pd-filter-badge.category-safety.active {
  background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
  border-color: #4CAF50;
  color: white;
}

.pd-filter-badge.category-engineering {
  border-color: #2196F3;
  color: #1565C0;
}

.pd-filter-badge.category-engineering.active {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  border-color: #2196F3;
  color: white;
}

.pd-filter-badge.category-quality {
  border-color: #9C27B0;
  color: #6A1B9A;
}

.pd-filter-badge.category-quality.active {
  background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
  border-color: #9C27B0;
  color: white;
}

/* View Controls Bar - Replaces breadcrumb bar */
.pd-view-controls-bar {
  padding: 8px 12px;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 52px;
}

.pd-view-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pd-view-controls .pd-toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  margin: 0 3px;
}

/* Breadcrumb in Sidebar */
.pd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-color);
  flex-wrap: wrap;
}

.pd-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  line-height: 1.4;
  padding: 2px 4px;
  border-radius: 4px;
}

/* Only apply hover to clickable items (not active) */
.pd-breadcrumb-item:not(.active) {
  cursor: pointer;
}

.pd-breadcrumb-item:not(.active):hover {
  background: rgba(70, 130, 180, 0.08);
  color: #4682b4;
}

.pd-breadcrumb-item.active {
  color: #2e4d6f;
  font-weight: 600;
  cursor: default;
  background: rgba(70, 130, 180, 0.1);
}

.pd-breadcrumb-item .fa {
  font-size: 11px;
}

.pd-breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin: 0 4px;
  color: #4682b4;
  font-weight: 400;
}

/* View Toggle */
.pd-view-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Main Content Area */
.pd-main-body {
  padding: 6px;
  padding-top: 21px;
  flex: 1;
  overflow-y: auto;
}

/* Content Area - Direct child of main panel */
.pd-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 9px;
}

/* Loading State */
.pd-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.pd-loading .fa {
  font-size: 2em;
  margin-bottom: 12px;
  color: #4682b4;
}

.pd-loading p {
  font-size: 13px;
  margin: 0;
}

/* Empty State */
.pd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.pd-empty-state .fa {
  font-size: 3em;
  color: #d1d5db;
  margin-bottom: 12px;
}

.pd-empty-state h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 6px;
}

.pd-empty-state p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Document Grid - Enhanced Appealing Distribution */
.pd-document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  padding: 2px; /* Prevent cut-off shadows */
}

/* Optional: Featured/First item larger */
.pd-doc-card:first-child {
  grid-column: span 1;
  grid-row: span 1;
}

.pd-doc-card {
  background: white;
  border: 1px solid rgba(70, 130, 180, 0.12);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 6px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.03);
}

.pd-doc-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 12px 24px rgba(70, 130, 180, 0.12),
    0 8px 16px rgba(46, 77, 111, 0.08),
    0 4px 8px rgba(0, 0, 0, 0.06);
  border-color: rgba(70, 130, 180, 0.4);
  z-index: 10;
}

.pd-doc-card:active {
  transform: translateY(-6px) scale(1.01);
  transition: all 0.15s ease;
}

.pd-doc-card.selected {
  border-color: #4682b4;
  box-shadow:
    0 0 0 3px rgba(70, 130, 180, 0.15),
    0 8px 16px rgba(70, 130, 180, 0.2);
  transform: translateY(-2px);
}

/* ===== PD DATA CARDS (Blue Theme for Structured Content) ===== */
.pd-data-card {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.03) 0%, rgba(70, 130, 180, 0.05) 100%);
  border: 2px solid rgba(33, 150, 243, 0.2);
  border-radius: 12px;
  overflow: visible; /* Changed from hidden to show ellipsis button */
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 6px;
  box-shadow:
    0 1px 3px rgba(33, 150, 243, 0.08),
    0 1px 2px rgba(33, 150, 243, 0.06);
}

/* Ellipsis button for PD Data cards - match PD Document styling */
.pd-data-card .pd-doc-more-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  color: #4682b4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.pd-data-card:hover .pd-doc-more-btn {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.pd-data-card .pd-doc-more-btn:hover {
  background: rgba(70, 130, 180, 0.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pd-data-card .pd-doc-more-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.pd-data-card .pd-doc-more-btn .fa {
  font-size: 14px;
  color: #4682b4;
}

/* Always visible on mobile */
@media (max-width: 768px) {
  .pd-data-card .pd-doc-more-btn {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    width: 36px;
    height: 36px;
  }
}

.pd-data-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 12px 24px rgba(33, 150, 243, 0.18),
    0 8px 16px rgba(33, 150, 243, 0.12),
    0 4px 8px rgba(33, 150, 243, 0.08);
  border-color: rgba(33, 150, 243, 0.5);
  z-index: 10;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.06) 0%, rgba(70, 130, 180, 0.08) 100%);
}

.pd-data-card:active {
  transform: translateY(-6px) scale(1.01);
  transition: all 0.15s ease;
}

.pd-data-card.selected {
  border-color: #2196F3;
  box-shadow:
    0 0 0 3px rgba(33, 150, 243, 0.2),
    0 8px 16px rgba(33, 150, 243, 0.25);
  transform: translateY(-2px);
}

/* Data card preview area - blue theme with database icon */
.pd-data-preview {
  height: 140px;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.12) 0%, rgba(70, 130, 180, 0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #2196F3;
  font-size: 3em;
  position: relative;
  border-bottom: 2px solid rgba(33, 150, 243, 0.15);
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
}

.pd-data-card:hover .pd-data-preview {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.18) 0%, rgba(70, 130, 180, 0.12) 100%);
  color: #1976D2;
}

/* DocType badge on data preview */
.pd-data-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(33, 150, 243, 0.9);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  font-family: 'Raleway', Arial, sans-serif;
}

/* DATA badge in card footer */
.pd-data-badge {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
  font-family: 'Raleway', Arial, sans-serif;
}

/* Source DocType label in metadata */
.pd-doc-source {
  color: #2196F3;
  font-weight: 600;
  font-size: 12px;
}

.pd-doc-preview {
  height: 140px;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.08) 0%, rgba(46, 77, 111, 0.04) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4682b4;
  font-size: 3em;
  position: relative;
  border-bottom: 1px solid rgba(70, 130, 180, 0.08);
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
}

/* Favorite indicator - small star in top right corner */
.pd-favorite-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(255, 193, 7, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.pd-favorite-indicator i {
  font-size: 12px;
  color: white;
}

/* Favorite star in list view */
.pd-favorite-star {
  margin-left: 8px;
  color: #FFC107;
  font-size: 14px;
}

/* Reference indicator - small link icon in top left corner */
.pd-reference-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background: rgba(33, 150, 243, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.pd-reference-indicator i {
  font-size: 11px;
  color: white;
}

/* Reference icon in list view */
.pd-reference-icon {
  margin-left: 8px;
  color: #2196F3;
  font-size: 13px;
}

/* Cloud indicator - small cloud icon in bottom left corner (for raw cloud files) */
.pd-cloud-indicator {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background: rgba(33, 150, 243, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.pd-cloud-indicator i {
  font-size: 11px;
  color: white;
}

/* Document indicator - small document icon in bottom left corner (for PD Cloud Documents) */
.pd-document-indicator {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background: rgba(76, 175, 80, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.pd-document-indicator i {
  font-size: 11px;
  color: white;
}

/* Cloud icon in list view */
.pd-cloud-icon {
  margin-left: 8px;
  color: #2196F3;
  font-size: 13px;
}

/* Cloud badge (for raw cloud files) */
.pd-cloud-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  background: rgba(33, 150, 243, 0.1);
  color: #2196F3;
  border-radius: 3px;
  font-weight: 500;
  margin-left: 4px;
}

.pd-cloud-badge i {
  font-size: 10px;
  margin-right: 3px;
}

/* Document badge (for PD Cloud Documents) */
.pd-document-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  background: rgba(76, 175, 80, 0.1);
  color: #4CAF50;
  border-radius: 3px;
  font-weight: 500;
  margin-left: 4px;
}

.pd-document-badge i {
  font-size: 10px;
  margin-right: 3px;
}

/* Reference badge */
.pd-reference-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(33, 150, 243, 0.15);
  color: #2196F3;
  border-radius: 3px;
  margin-left: 4px;
}

.pd-doc-card:hover .pd-doc-preview {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.12) 0%, rgba(46, 77, 111, 0.08) 100%);
}

.pd-doc-preview.folder {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, rgba(220, 50, 40, 0.1) 100%);
  color: rgb(244, 67, 54);
}

/* Category Border Colors - Enhanced */
.pd-doc-preview[data-category="waste"] {
  border-top: 4px solid #FF9800;
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.08) 0%, rgba(255, 152, 0, 0.04) 100%);
}

.pd-doc-preview[data-category="safety"] {
  border-top: 4px solid #4CAF50;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.08) 0%, rgba(76, 175, 80, 0.04) 100%);
}

.pd-doc-preview[data-category="engineering"] {
  border-top: 4px solid #2196F3;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.08) 0%, rgba(33, 150, 243, 0.04) 100%);
}

.pd-doc-preview[data-category="quality"] {
  border-top: 4px solid #9C27B0;
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.08) 0%, rgba(156, 39, 176, 0.04) 100%);
}

/* Category glow effect on hover */
.pd-doc-card:hover .pd-doc-preview[data-category="waste"] {
  box-shadow: inset 0 0 20px rgba(255, 152, 0, 0.1);
}

.pd-doc-card:hover .pd-doc-preview[data-category="safety"] {
  box-shadow: inset 0 0 20px rgba(76, 175, 80, 0.1);
}

.pd-doc-card:hover .pd-doc-preview[data-category="engineering"] {
  box-shadow: inset 0 0 20px rgba(33, 150, 243, 0.1);
}

.pd-doc-card:hover .pd-doc-preview[data-category="quality"] {
  box-shadow: inset 0 0 20px rgba(156, 39, 176, 0.1);
}

.pd-doc-info {
  padding: 0;
  padding-top: 6px;
  background: var(--bg-primary);
}

.pd-doc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.pd-doc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1;
}

.pd-doc-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pd-doc-category-badge {
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}

.pd-doc-category-badge.waste {
  background: #fff3e0;
  color: #e65100;
}

.pd-doc-category-badge.safety {
  background: #e8f5e9;
  color: #2e7d32;
}

.pd-doc-category-badge.engineering {
  background: #e3f2fd;
  color: #1565c0;
}

.pd-doc-category-badge.quality {
  background: #f3e5f5;
  color: #6a1b9a;
}

.pd-workflow-badge {
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.pd-workflow-badge.draft {
  background: #f3f4f6;
  color: #6b7280;
}

.pd-workflow-badge.under-review {
  background: #fef3c7;
  color: #92400e;
}

.pd-workflow-badge.approved {
  background: #d1fae5;
  color: #065f46;
}

.pd-workflow-badge.archived {
  background: #e5e7eb;
  color: #4b5563;
}

/* Document Actions */
.pd-doc-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  gap: 3px;
}

.pd-doc-card:hover .pd-doc-actions {
  display: flex;
}

.pd-doc-action-btn {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #4682b4;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pd-doc-action-btn:hover {
  background: #4682b4;
  color: white;
  transform: scale(1.1);
}

.pd-doc-action-btn .fa {
  font-size: 11px;
}

/* Document List/Table View */
.pd-document-table {
  width: 100%;
  background: var(--bg-primary);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.pd-document-table thead {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.08) 0%, rgba(46, 77, 111, 0.04) 100%);
}

.pd-document-table th {
  padding: 6px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.2;
}

.pd-document-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.pd-document-table tbody tr:hover {
  background: rgba(70, 130, 180, 0.05);
}

.pd-document-table tbody tr.selected {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.1) 0%, rgba(46, 77, 111, 0.1) 100%);
}

.pd-document-table td {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-color);
  line-height: 1.2;
}

.pd-table-doc-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-table-doc-icon {
  width: 32px;
  height: 32px;
  background: rgba(70, 130, 180, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4682b4;
  flex-shrink: 0;
}

.pd-table-doc-icon .fa {
  font-size: 14px;
}

/* ===== RIGHT DETAILS PANEL - SLIDING CURTAIN ===== */
.pd-details-panel {
  position: fixed;
  top: calc(var(--navbar-height, 48px) + 6px); /* Below navbar with gap - CONSISTENT WITH CHAT PANEL */
  right: 0;
  bottom: 6px; /* Gap from bottom - CONSISTENT WITH CHAT PANEL */
  width: 400px;
  background: white;
  border-left: 1px solid rgba(70, 130, 180, 0.2);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  z-index: 1045; /* Below chat panel, above navbar */
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-top-left-radius: 12px; /* Match chat panel */
  border-bottom-left-radius: 12px; /* Match chat panel */
  overflow: hidden;
}

.pd-details-panel.active {
  transform: translateX(0);
}

.pd-details-panel.collapsed {
  transform: translateX(100%);
}

/* Optional: Backdrop overlay when details panel is open */
.pd-details-backdrop {
  position: fixed;
  top: 0; /* Cover entire screen including navbar - CONSISTENT WITH CHAT PANEL */
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1044; /* Just below details panel */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.pd-details-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Details Header */
.pd-details-header {
  padding: 9px;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.08) 0%, rgba(46, 77, 111, 0.04) 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.details-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.details-title .fa {
  color: #4682b4;
  font-size: 14px;
}

.btn-close-details {
  width: 32px;
  height: 32px;
  padding: 0;
  background: white;
  color: #4682b4;
  border: 1px solid #4682b4;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-details:hover {
  background: #4682b4;
  color: white;
}

.btn-close-details .fa {
  font-size: 14px;
}

/* Details Body */
.pd-details-body {
  padding: 9px;
  flex: 1;
  overflow-y: auto;
}

/* Details Content */
.pd-details-content {
  padding: 9px;
  flex: 1;
  overflow-y: auto;
}

/* No Selection State */
.pd-no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.pd-no-selection .fa {
  font-size: 2.5em;
  margin-bottom: 12px;
  color: #d1d5db;
}

.pd-no-selection p {
  font-size: 12px;
  margin: 0;
}

/* File Preview */
.pd-preview {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.pd-preview-placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.1) 0%, rgba(46, 77, 111, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4682b4;
  font-size: 3em;
}

.pd-preview img {
  width: 100%;
  height: auto;
  display: block;
}

/* Metadata */
.pd-doc-title {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Raleway', Arial, sans-serif;
  color: var(--text-color);
  margin-bottom: 12px;
  word-wrap: break-word;
  line-height: 1.2;
}

.pd-metadata-group {
  margin-bottom: 12px;
}

.pd-metadata-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pd-metadata-value {
  font-size: 12px;
  color: var(--text-color);
  line-height: 1.2;
}

.pd-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(70, 130, 180, 0.1);
  font-size: 11px;
  font-weight: 600;
  color: #2e4d6f;
}

.category-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pd-sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgb(76, 175, 80);
}

.pd-sync-status .fa {
  font-size: 11px;
}

/* Details Actions */
.pd-details-actions {
  padding: 9px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pd-btn-block {
  width: 100%;
  justify-content: center;
}

/* Activity Feed */
.pd-activity-feed {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.pd-activity-feed h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pd-activity-feed h4 .fa {
  color: #4682b4;
  font-size: 11px;
}

.pd-activity-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.pd-activity-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.pd-activity-item .fa {
  width: 28px;
  height: 28px;
  background: rgba(70, 130, 180, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4682b4;
  font-size: 11px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 11px;
  color: var(--text-color);
  margin-bottom: 3px;
  line-height: 1.2;
}

.activity-time {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1;
}

/* ===== MODALS ===== */
.pd-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.pd-modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

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

.pd-modal-header {
  padding: 6px;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.08) 0%, rgba(46, 77, 111, 0.04) 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pd-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Raleway', Arial, sans-serif;
  color: var(--text-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-modal-header h3 .fa {
  color: #4682b4;
  font-size: 14px;
}

.pd-modal-body {
  padding: 16px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.pd-modal-footer {
  padding: 6px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* Upload Zone */
.pd-upload-zone {
  border: 2px dashed rgba(70, 130, 180, 0.3);
  border-radius: 8px;
  padding: 32px 16px;
  text-align: center;
  transition: all 0.2s;
  margin-bottom: 16px;
  background: rgba(70, 130, 180, 0.02);
}

.pd-upload-zone:hover,
.pd-upload-zone.drag-over {
  border-color: #4682b4;
  background: rgba(70, 130, 180, 0.08);
}

.pd-upload-zone .fa {
  font-size: 3em;
  color: #4682b4;
  margin-bottom: 12px;
}

.pd-upload-zone h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 6px;
}

.pd-upload-zone p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0;
}

.upload-hint {
  font-size: 10px;
  color: #888;
}

/* Form Controls */
.pd-upload-options .form-group {
  margin-bottom: 12px;
}

.pd-upload-options label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
}

.pd-upload-options .form-control {
  width: 100%;
  padding: 3px 8px;
  border: 1px solid rgba(76, 212, 192, 0.3);
  border-radius: 6px;
  background: white;
  color: #333;
  font-size: 0.85rem;
  height: 28px;
  line-height: 1.2;
  transition: all 0.2s ease;
}

.pd-upload-options .form-control:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.1);
}

.pd-upload-options select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L7 7L13 1' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 30px;
}

/* ===== ELLIPSIS BUTTON ===== */
.pd-doc-more-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  color: #4682b4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

/* Show on card hover (desktop) */
.pd-doc-card:hover .pd-doc-more-btn {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Always visible on mobile */
@media (max-width: 768px) {
  .pd-doc-more-btn {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    width: 36px;
    height: 36px;
  }
}

.pd-doc-more-btn:hover {
  background: rgba(70, 130, 180, 0.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pd-doc-more-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.pd-doc-more-btn .fa {
  font-size: 14px;
}

/* List view button styling */
.pd-row-actions {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}

.pd-row-actions .pd-doc-more-btn {
  position: relative;
  top: 0;
  left: 0;
  margin: 0 auto;
}

/* ===== CONTEXT MENU ===== */
.pd-context-menu {
  position: fixed;
  display: block;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px;
  min-width: 180px;
  z-index: 1000000002;
  animation: contextMenuFadeIn 0.15s ease-out;
}

/* Mobile touch optimizations */
@media (max-width: 768px) {
  .pd-context-item {
    padding: 6px 14px;
    font-size: 14px;
    min-height: 36px;
  }

  .pd-context-menu {
    padding: 3px;
  }

  .pd-context-divider {
    margin: 1px 0;
  }
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pd-context-item {
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
  font-size: 13px;
  color: var(--text-color);
  line-height: 1.3;
}

.pd-context-item:hover {
  background: rgba(70, 130, 180, 0.08);
}

.pd-context-item.danger {
  color: rgb(244, 67, 54);
}

.pd-context-item.danger:hover {
  background: rgba(244, 67, 54, 0.1);
}

.pd-context-item .fa {
  width: 16px;
  text-align: center;
  font-size: 12px;
  color: #4682b4;
}

.pd-context-item.danger .fa {
  color: rgb(244, 67, 54);
}

.pd-context-divider {
  height: 1px;
  background: var(--border-color);
  margin: 2px 0;
}

/* Arrow pointer for context menu opening to the right */
.pd-context-menu.open-right::after {
  content: '';
  position: absolute;
  top: 16px;
  left: -8px;
  width: 0;
  height: 0;
  border-right: 8px solid white;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  z-index: 1001;
}

.pd-context-menu.open-right::before {
  content: '';
  position: absolute;
  top: 15px;
  left: -10px;
  width: 0;
  height: 0;
  border-right: 9px solid var(--border-color);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  z-index: 1000;
}

/* Highlight active card when context menu is open */
.pd-doc-card.context-menu-active,
.pd-doc-row.context-menu-active {
  outline: 2px solid #4682b4;
  outline-offset: 2px;
  background: rgba(70, 130, 180, 0.05);
  position: relative;
  z-index: 900;
}

.pd-doc-card.context-menu-active {
  box-shadow:
    0 0 0 2px rgba(70, 130, 180, 0.2),
    0 8px 24px rgba(70, 130, 180, 0.15);
  transform: translateY(-2px);
}

/* ===== FOLDER CONTEXT MENU ===== */
.pd-folder-context-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 6px;
  min-width: 180px;
  font-size: 12px;
  z-index: 99999;
  overflow: hidden;
}

.context-menu-item {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
  background: #ffffff;
  color: var(--text-color);
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 4px;
}

.context-menu-item:hover {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.12) 0%, rgba(46, 77, 111, 0.12) 100%);
}

.context-menu-item i {
  width: 14px;
  text-align: center;
  color: #2e4d6f;
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.context-menu-item:hover i {
  transform: scale(1.1);
}

.context-menu-item span {
  font-size: 12px;
  font-weight: 500;
}

.context-menu-item[data-action="delete"]:hover {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.15) 0%, rgba(220, 53, 69, 0.1) 100%);
  color: #dc3545;
}

.context-menu-item[data-action="delete"]:hover i {
  color: #dc3545;
  transform: scale(1.15);
}

.context-menu-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(70, 130, 180, 0.3) 50%, transparent 100%);
  margin: 6px 8px;
}

/* ===== SCROLLBAR STYLING ===== */
.pd-sidebar-body::-webkit-scrollbar,
.pd-main-body::-webkit-scrollbar,
.pd-details-body::-webkit-scrollbar {
  width: 6px;
}

.pd-sidebar-body::-webkit-scrollbar-track,
.pd-main-body::-webkit-scrollbar-track,
.pd-details-body::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 3px;
}

.pd-sidebar-body::-webkit-scrollbar-thumb,
.pd-main-body::-webkit-scrollbar-thumb,
.pd-details-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.pd-sidebar-body::-webkit-scrollbar-thumb:hover,
.pd-main-body::-webkit-scrollbar-thumb:hover,
.pd-details-body::-webkit-scrollbar-thumb:hover {
  background: #2e4d6f;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Extra large screens - wider sidebar and 5 columns */
/* ===== RESPONSIVE DESIGN ===== */

/* Extra Large Screens - 5+ columns */
@media (min-width: 1600px) {
  .pd-document-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }
}

/* Large Screens - 4 columns */
@media (max-width: 1599px) and (min-width: 1200px) {
  .pd-document-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
  }
}

/* Medium Screens - narrower sidebar, 3 columns */
@media (max-width: 1199px) and (min-width: 992px) {
  .pd-sidebar {
    width: 280px;
    min-width: 280px;
  }

  .pd-document-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }

  .pd-details-panel {
    width: 350px;
  }
}

/* Tablet Landscape - narrower sidebar, 2-3 columns */
@media (max-width: 991px) and (min-width: 769px) {
  .pd-sidebar {
    width: 260px;
    min-width: 260px;
  }

  .pd-document-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .pd-details-panel {
    width: 320px;
  }

  .pd-toolbar {
    flex-wrap: nowrap; /* Keep in one row */
    gap: 8px;
  }

  .pd-toolbar-right {
    flex: 1;
    max-width: none; /* Allow to expand */
    min-width: 0; /* Allow to shrink */
  }

  .pd-search-box {
    width: 100%;
    min-width: 120px; /* Minimum width for functionality */
  }
}

/* Tablet Portrait & Mobile - Collapsible Sidebar */
@media (max-width: 768px) {
  .pd-drive-container {
    padding: 0;
    height: calc(100vh - 60px);
    max-width: 100vw; /* Prevent horizontal overflow */
    overflow-x: hidden; /* Hide any overflow */
  }

  /* Ensure all children respect container width */
  .pd-drive-container * {
    box-sizing: border-box;
  }

  /* Hide sidebar by default on mobile */
  .pd-sidebar {
    position: fixed;
    left: -69%; /* Hide offscreen */
    top: 54px; /* Below navbar (48px) + gap (6px) - SAME AS RIGHT PANEL */
    bottom: 6px; /* Gap from bottom (6px) - SAME AS RIGHT PANEL */
    width: 69%; /* 69% width to allow clicking outside */
    min-width: 260px; /* Minimum usable width */
    max-width: 69%;
    height: auto; /* Auto height based on top/bottom */
    z-index: 1000000001 !important; /* Extremely high to show over all Frappe elements */
    transition: left 0.3s ease;
    border-radius: 0 12px 12px 0; /* Rounded right corners - SAME AS RIGHT PANEL */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    background: white !important;
    background-color: #ffffff !important;
    border-top: 2px solid var(--border-color); /* Top border - SAME AS RIGHT PANEL */
    border-bottom: 2px solid var(--border-color); /* Bottom border - SAME AS RIGHT PANEL */
    border-right: 2px solid var(--border-color); /* Right border - SAME AS RIGHT PANEL */
    border-left: none;
    overflow-y: auto; /* Allow scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    -webkit-transform: translateZ(0); /* Hardware acceleration for iOS */
    transform: translateZ(0);
    display: flex; /* Flex container */
    flex-direction: column; /* Vertical layout */
  }

  /* iOS Safari specific fixes for sidebar */
  @supports (-webkit-touch-callout: none) {
    .pd-sidebar {
      /* Ensure fixed positioning on iOS - SAME AS RIGHT PANEL */
      top: 54px !important; /* Below navbar with gap */
      bottom: 6px !important; /* Gap from bottom */
      height: auto !important; /* Auto height based on top/bottom */
      position: fixed !important;
    }
  }

  /* Show sidebar when active */
  .pd-drive-container.sidebar-active .pd-sidebar {
    left: 0;
  }

  /* Mobile sidebar overlay - SAME AS RIGHT PANEL */
  .pd-drive-container.sidebar-active::before {
    content: '';
    position: fixed;
    top: 48px; /* Start at navbar height (48px) - SAME AS RIGHT PANEL */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000000000 !important; /* Just below sidebar, above everything else */
  }

  /* Hide resize handle on mobile */
  .pd-resize-handle {
    display: none;
  }

  /* Main panel takes full width */
  .pd-main-panel {
    width: 100%;
    flex: 1;
    min-width: 0; /* Remove desktop min-width constraint */
    max-width: 100%; /* Ensure it doesn't overflow */
    border-left: 1px solid var(--border-color); /* Restore left border since no sidebar */
    border-radius: 12px; /* Full rounded corners on mobile */
    margin-left: 0; /* Remove negative margin */
    padding: 0;
  }

  /* Show sidebar toggle button */
  .pd-sidebar-toggle {
    display: flex !important;
  }

  /* Toolbar adjustments - keep in one row */
  .pd-toolbar {
    flex-wrap: nowrap; /* Force single row */
    padding: 6px;
    gap: 4px;
    min-height: 44px;
  }

  .pd-toolbar-left {
    gap: 4px;
    flex-shrink: 0; /* Don't shrink buttons */
  }

  .pd-toolbar-right {
    flex: 1;
    min-width: 0; /* Allow to shrink */
    max-width: none;
  }

  .pd-search-box {
    width: 100%;
    max-width: 100%;
    min-width: 100px; /* Minimum functional width */
  }

  /* Make buttons more compact on mobile */
  .pd-toolbar .pd-btn-icon {
    width: 32px;
    height: 32px;
    padding: 6px;
  }

  .pd-toolbar .pd-btn-icon i {
    font-size: 14px;
  }

  /* Path bar adjustments */
  .pd-path-bar {
    padding: 6px 8px;
    gap: 6px;
  }

  .pd-path-input-container {
    padding: 4px 8px;
  }

  /* Document grid - 2 columns */
  .pd-document-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 4px;
    max-width: 100%; /* Prevent overflow */
    box-sizing: border-box;
  }

  /* Content area - prevent overflow */
  .pd-content-area {
    max-width: 100%;
    overflow-x: hidden;
    padding: 0;
  }

  .pd-doc-card {
    border-radius: 10px;
    padding: 4px;
  }

  .pd-doc-preview {
    height: 120px;
    font-size: 2.5em;
  }

  /* Details panel - 90% width */
  .pd-details-panel {
    width: 90%;
    max-width: 350px;
  }

  /* View controls */
  .pd-view-controls-bar {
    padding: 6px 8px;
  }

  /* Sidebar sections more compact */
  .pd-sidebar-section {
    padding: 8px;
  }

  /* Remove padding from full-width widgets on mobile */
  .widget.custom-block-widget-box.full-width {
    padding: 0 !important;
    margin: 0 !important;
  }

  .widget.custom-block-widget-box.full-width .widget-body {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Remove padding from CE blocks on mobile */
  [data-page-route="Workspaces"] .codex-editor .codex-editor__redactor .ce-block .ce-block__content {
    padding: 0 !important;
  }

  [data-page-route="Workspaces"] .codex-editor .codex-editor__redactor .ce-block {
    padding: 0 !important;
  }
}

  .pd-section-header {
    padding: 6px 0;
  }

  .pd-filter-badge,
  .pd-category-badge {
    font-size: 9px;
    padding: 3px 5px;
    gap: 3px;
  }

  .pd-category-badge i {
    font-size: 9px;
  }

  .pd-category-name {
    font-size: 8px;
  }

  /* Workspace selector compact - ensure visible on mobile */
  .pd-workspace-selector {
    padding: 10px;
    min-height: 52px;
    margin-top: 0;
    position: sticky; /* Stick to top when scrolling */
    top: 0; /* Stick at top of sidebar */
    background: linear-gradient(135deg, rgba(70, 130, 180, 0.04) 0%, rgba(46, 77, 111, 0.02) 100%);
    z-index: 10; /* Above other sidebar content */
    flex-shrink: 0; /* Don't shrink */
    border-bottom: 1px solid var(--border-color); /* Visual separation */
  }

  .pd-workspace-dropdown {
    font-size: 13px;
    padding: 8px 10px;
    min-height: 36px;
  }

  /* Ensure floating label is visible on mobile */
  .pd-workspace-selector .floating-label {
    top: -14px;
    font-size: 11px;
  }

  /* Folder list header */
  .pd-folder-list-header {
    padding: 6px 10px;
  }
}

/* Mobile Small - 1 column, full-width details */
@media (max-width: 480px) {
  .pd-drive-container {
    height: calc(100vh - 50px);
    max-width: 100vw; /* Prevent horizontal overflow */
    overflow-x: hidden; /* Hide any overflow */
  }

  /* Main panel - ensure no overflow */
  .pd-main-panel {
    min-width: 0;
    max-width: 100%;
  }

  /* Sidebar 69% width on small mobile too */
  .pd-sidebar {
    width: 69%;
    min-width: 240px; /* Smaller minimum for very small screens */
    max-width: 69%;
    /* Keep same top/bottom positioning as tablet */
    top: 54px;
    bottom: 6px;
  }

  /* Path bar more compact */
  .pd-path-bar {
    padding: 4px 6px;
    min-height: 44px;
  }

  .pd-path-input {
    font-size: 12px;
  }

  /* Toolbar very compact */
  .pd-toolbar {
    padding: 6px;
    gap: 4px;
  }

  .pd-toolbar-left {
    gap: 4px;
  }

  .pd-btn-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .pd-btn-icon .fa {
    font-size: 14px;
  }

  /* Single column grid */
  .pd-document-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

  .pd-doc-preview {
    height: 180px;
    font-size: 3.5em;
  }

  .pd-doc-info {
    padding: 10px;
  }

  .pd-doc-title {
    font-size: 13px;
  }

  .pd-doc-meta {
    font-size: 10px;
  }

  /* Full width details panel */
  .pd-details-panel {
    width: 100%;
    max-width: 100%;
  }

  /* View controls compact */
  .pd-view-controls-bar {
    padding: 4px 6px;
  }

  /* Sidebar sections very compact */
  .pd-sidebar-section {
    padding: 6px;
  }

  .pd-filter-badge,
  .pd-category-badge {
    font-size: 8px;
    padding: 2px 4px;
    gap: 2px;
  }

  .pd-category-badge i {
    font-size: 8px;
  }

  .pd-category-name {
    font-size: 7px;
  }

  .pd-badge-count {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    line-height: 16px;
  }

  /* Workspace selector very compact */
  .pd-workspace-selector {
    padding: 4px 8px;
    min-height: 40px;
  }

  .pd-workspace-dropdown {
    font-size: 12px;
    padding: 4px 8px;
  }

  /* Search input smaller */
  .pd-search-box input,
  .pd-filter-search-input {
    font-size: 12px;
  }

  /* Folder items compact */
  .pd-folder-item {
    padding: 6px 8px;
    font-size: 12px;
  }

  /* Modal adjustments */
  .pd-modal-content {
    width: 95%;
    margin: 10px;
  }

  .pd-modal-header h3 {
    font-size: 16px;
  }

  .pd-modal-body {
    padding: 12px;
  }
}

/* Mobile Extra Small - Optimize for very small screens */
@media (max-width: 360px) {
  .pd-sidebar {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
  }

  .pd-path-bar {
    padding: 4px;
  }

  .pd-toolbar {
    padding: 4px;
  }

  .pd-btn-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .pd-btn-icon .fa {
    font-size: 12px;
  }

  .pd-document-grid {
    padding: 8px;
    gap: 10px;
  }

  .pd-doc-preview {
    height: 150px;
  }

  .pd-section-title {
    font-size: 11px;
  }

  .pd-workspace-dropdown {
    font-size: 11px;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* ===== METADATA AND VERSION CONTAINERS ===== */
/* These are modal overlays that should be hidden by default */
.pd-metadata-container,
.pd-version-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
}

.pd-metadata-container.active,
.pd-version-container.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== FOLDER TREE DIALOG ===== */
.pd-tree-modal-content {
  max-width: 700px;
  width: 90%;
}

.pd-tree-dialog-content {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
}

/* Tree root node in dialog */
.pd-tree-dialog-content .pd-tree-root {
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  background: rgba(70, 130, 180, 0.08);
  border: 2px solid transparent;
}

.pd-tree-dialog-content .pd-tree-root:hover {
  background: rgba(70, 130, 180, 0.15);
  border-color: rgba(70, 130, 180, 0.3);
}

.pd-tree-dialog-content .pd-tree-root .fa-home {
  color: #4682b4;
  font-size: 14px;
}

/* Tree items in dialog */
.pd-tree-dialog-content .pd-tree-item {
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin: 0;
  font-size: 13px;
  line-height: 1;
  border: 2px solid transparent;
  position: relative;
}

.pd-tree-dialog-content .pd-tree-item:hover {
  background: rgba(70, 130, 180, 0.1);
  border-color: rgba(70, 130, 180, 0.2);
}

.pd-tree-dialog-content .pd-tree-item.selected {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.2) 0%, rgba(46, 77, 111, 0.2) 100%);
  border-color: #4682b4;
  font-weight: 600;
}

.pd-tree-dialog-content .pd-tree-item .fa-folder,
.pd-tree-dialog-content .pd-tree-item .fa-folder-open {
  font-size: 14px;
  color: #4682b4;
  flex-shrink: 0;
}

.pd-tree-dialog-content .pd-tree-item .fa-chevron-right,
.pd-tree-dialog-content .pd-tree-item .fa-chevron-down {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: #999;
  width: 14px;
  flex-shrink: 0;
}

.pd-tree-dialog-content .pd-tree-item.expanded .fa-chevron-right {
  transform: rotate(90deg);
}

.pd-tree-dialog-content .pd-tree-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-tree-dialog-content .pd-tree-item-count {
  font-size: 11px;
  font-weight: 700;
  color: white;
  /* Background color set dynamically via JavaScript gradient */
  background: #4682b4; /* Fallback color */
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Nested folder children in dialog */
.pd-tree-dialog-content .pd-tree-children {
  margin: 0;
  padding-left: 16px;
  border-left: 2px solid rgba(70, 130, 180, 0.2);
}

/* ===== FRAPPE TREE COMPONENT OVERRIDES ===== */
/* Override Frappe's default tree component styles for compact display */

/* Tree node container */
.modal-body .tree-node,
.modal-dialog .tree-node {
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

/* Tree link (clickable area) */
.modal-body .tree-link,
.modal-dialog .tree-link {
  padding: 3px 6px !important;
  margin: 0 !important;
  line-height: 1 !important;
  min-height: auto !important;
}

/* Tree label text */
.modal-body .tree-label,
.modal-dialog .tree-label {
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Tree children (nested items) - reduce indent */
.modal-body .tree-children,
.modal-dialog .tree-children {
  padding-left: 12px !important;
  margin: 0 !important;
}

/* Tree node list items */
.modal-body .tree-node > li,
.modal-dialog .tree-node > li {
  margin: 0 !important;
  padding: 0 !important;
}

/* Frappe tree component root */
.modal-body .frappe-tree,
.modal-dialog .frappe-tree {
  line-height: 1 !important;
}

.modal-body .frappe-tree .tree-node,
.modal-dialog .frappe-tree .tree-node {
  margin-bottom: 0 !important;
}

.modal-body .frappe-tree .tree-link,
.modal-dialog .frappe-tree .tree-link {
  padding: 3px 4px !important;
  line-height: 1 !important;
  min-height: 20px !important;
}

.modal-body .frappe-tree .tree-children,
.modal-dialog .frappe-tree .tree-children {
  padding-left: 12px !important;
}

/* Remove extra spacing from tree items */
.modal-body ul.tree,
.modal-dialog ul.tree {
  padding-left: 0 !important;
  margin: 0 !important;
}

.modal-body ul.tree > li,
.modal-dialog ul.tree > li {
  margin: 0 !important;
  padding: 0 !important;
}

/* Compact tree icons */
.modal-body .tree-link .fa,
.modal-dialog .tree-link .fa {
  font-size: 12px !important;
}

/* ===== CUSTOM TREE OVERRIDES (for dynamically generated trees) ===== */
/* Ultra-specific selectors to override inline styles */
.modal-body .frappe-tree-node,
.modal-dialog .frappe-tree-node,
div[data-fieldname="tree_area"] .frappe-tree-node,
.frappe-control .frappe-tree-node {
  padding: 2px 4px !important;
  margin-bottom: 0 !important;
  line-height: 1 !important;
  min-height: auto !important;
}

.modal-body .tree-node-container,
.modal-dialog .tree-node-container,
div[data-fieldname="tree_area"] .tree-node-container,
.frappe-control .tree-node-container {
  margin-bottom: 0 !important;
}

.modal-body .tree-children,
.modal-dialog .tree-children,
div[data-fieldname="tree_area"] .tree-children,
.frappe-control .tree-children {
  margin-left: 12px !important;
  padding-left: 0 !important;
}

.modal-body .frappe-tree-list,
.modal-dialog .frappe-tree-list,
div[data-fieldname="tree_area"] .frappe-tree-list,
.frappe-control .frappe-tree-list {
  margin-left: 12px !important;
}

/* Root node - ultra specific */
.modal-body .root-node,
.modal-dialog .root-node,
div[data-fieldname="tree_area"] .root-node,
.frappe-control .root-node {
  padding: 3px 4px !important;
  margin-bottom: 2px !important;
  line-height: 1 !important;
}

/* ========================================
   SEARCH HIGHLIGHTING
   ======================================== */

/* Highlighted search terms in context snippets */
mark {
  background-color: #fff59d; /* Light yellow */
  color: #000;
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* Alternative style for content search results */
.pd-content-area mark {
  background-color: #ffeb3b; /* Brighter yellow */
  box-shadow: 0 0 3px rgba(255, 235, 59, 0.5);
}

/* ===== SEMANTIC SEARCH SIMILARITY BADGES ===== */

/* Similarity indicator overlay on document card */
.pd-similarity-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

/* Score badge for ALL search modes (Semantic, Hybrid, Natural, Boolean, Phrase) */
.pd-similarity-badge,
.pd-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Figtree', Arial, sans-serif;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.pd-similarity-badge i,
.pd-score-badge i {
  font-size: 13px;
}

/* High score - Green (Semantic/Hybrid: 70%+, Fulltext: 3.0+) */
.pd-similarity-badge.high,
.pd-score-badge.high {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
}

.pd-similarity-badge.high:hover,
.pd-score-badge.high:hover {
  box-shadow: 0 3px 8px rgba(76, 175, 80, 0.4);
  transform: translateY(-1px);
}

/* Medium score - Orange (Semantic/Hybrid: 40-69%, Fulltext: 1.0-2.9) */
.pd-similarity-badge.medium,
.pd-score-badge.medium {
  background: linear-gradient(135deg, #ff9800, #ffa726);
  color: white;
}

.pd-similarity-badge.medium:hover,
.pd-score-badge.medium:hover {
  box-shadow: 0 3px 8px rgba(255, 152, 0, 0.4);
  transform: translateY(-1px);
}

/* Low score - Blue-gray (Semantic/Hybrid: <40%, Fulltext: <1.0) */
.pd-similarity-badge.low,
.pd-score-badge.low {
  background: linear-gradient(135deg, #607d8b, #78909c);
  color: white;
}

.pd-similarity-badge.low:hover,
.pd-score-badge.low:hover {
  box-shadow: 0 3px 8px rgba(96, 125, 139, 0.4);
  transform: translateY(-1px);
}

/* ===== AI CHAT SLIDE PANEL ===== */

/* Floating AI Button */
.pd-ai-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4682b4, #2e4d6f);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 999;
}

.pd-ai-chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 188, 212, 0.6);
}

.pd-ai-chat-fab i {
  font-size: 24px;
}

/* AI Chat Backdrop */
.pd-ai-chat-backdrop {
  position: fixed;
  top: 0; /* Cover entire screen including navbar */
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050; /* Above navbar (1030) but below modals (1055) */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.pd-ai-chat-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* AI Chat Panel - Sliding Curtain from Right */
.pd-ai-chat-panel {
  position: fixed !important;
  /* Overlay on top like Frappe dialogs - covers page-head */
  top: calc(var(--navbar-height, 48px) + 6px) !important; /* Below navbar with gap */
  right: -70%; /* Hidden offscreen */
  bottom: 6px !important; /* gap from bottom */
  width: 70%; /* Desktop width */
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  z-index: 1051 !important; /* Above backdrop, above navbar, above page-head */
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  overflow: hidden;
}

.pd-ai-chat-panel.active {
  right: 0; /* Slide in from offscreen, match slide panel */
}

/* Mobile responsive (match slide panel) */
@media (max-width: 768px) {
  .pd-ai-chat-panel {
    width: calc(100% - 12px) !important;
    right: -100% !important;
  }
}

/* AI Chat Header (blue gradient like Frappe dialogs) */
.pd-ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #4682b4 0%, #2e4d6f 100%);
  border-bottom: 2px solid #2e4d6f;
  color: white;
  flex-shrink: 0;
}

/* Curtain Header (same style as AI Chat Header) */
.pd-curtain-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px;
  background: linear-gradient(135deg, #4682b4 0%, #2e4d6f 100%);
  border-bottom: 2px solid #2e4d6f;
  flex-shrink: 0;
}

.pd-ai-chat-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
  flex: 1;
  font-family: 'Raleway', Arial, sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-ai-chat-title .fa {
  color: white;
  font-size: 16px;
}

/* AI Chat Header Buttons - MUST be in CSS for Shadow DOM */
.pd-ai-chat-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white !important;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pd-ai-chat-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.pd-ai-chat-btn i,
.pd-ai-chat-btn .fa {
  color: white !important;
  font-size: 16px;
}

.pd-close-ai-chat:hover {
  background: rgba(244, 67, 54, 0.3);
  color: #f44336 !important;
  transform: rotate(90deg);
}

/* AI Chat Content */
.pd-ai-chat-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pd-ai-chat-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 12px;
}

.pd-ai-chat-loading i {
  font-size: 32px;
  color: #4682b4;
}

.pd-ai-chat-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.pd-ai-chat-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* AI Chat Footer */
.pd-ai-chat-footer {
  padding: 12px 20px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.pd-ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.pd-ai-status i {
  animation: pulse 2s ease-in-out infinite;
}

.pd-ai-model-info {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Context Bar */
.pd-ai-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  background: var(--pibico-light-gray);
  border-bottom: 1px solid var(--pibico-mid-gray);
  flex-shrink: 0;
}

.pd-ai-context-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-color);
}

.pd-ai-context-info i {
  color: #4682b4;
}

.pd-clear-chat {
  opacity: 0.6;
  transition: opacity 0.2s;
}

.pd-clear-chat:hover {
  opacity: 1;
  background: var(--control-bg-hover);
}

/* Messages Container */
.pd-ai-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  background: #fafafa;
  min-height: 0;
}

.pd-ai-messages-container::-webkit-scrollbar {
  width: 6px;
}

.pd-ai-messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.pd-ai-messages-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.pd-ai-messages-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Message Bubbles */
.pd-ai-message {
  display: flex;
  gap: 12px;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pd-ai-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.pd-ai-assistant .pd-ai-message-avatar {
  background: linear-gradient(135deg, #4682b4, #2e4d6f);
  color: white;
  padding: 6px;
}

.pd-ai-assistant .pd-ai-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1); /* Make SVG white */
}

.pd-ai-user .pd-ai-message-avatar {
  background: var(--primary);
  color: white;
}

.pd-ai-message-content {
  flex: 1;
  min-width: 0;
}

.pd-ai-message-text {
  background: white !important;
  padding: 6px 12px !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid var(--pibico-light-gray) !important;
  font-family: 'Figtree', Arial, sans-serif !important;
  line-height: 1 !important;
  font-size: 14px !important;
  color: #2c3e50 !important;
}

.pd-ai-user .pd-ai-message-text {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

/* ALL elements inside message - consistent padding and line-height */
.pd-ai-message-text p,
.pd-ai-message-text h1,
.pd-ai-message-text h2,
.pd-ai-message-text h3,
.pd-ai-message-text h4,
.pd-ai-message-text h5,
.pd-ai-message-text h6,
.pd-ai-message-text li,
.pd-ai-message-text div,
.pd-ai-message-text span,
.pd-ai-message-text blockquote {
  margin: 0 !important;
  padding: 3px 0 !important;
  line-height: 1 !important;
  font-family: 'Figtree', Arial, sans-serif !important;
  color: #2c3e50 !important;
}

/* Paragraphs */
.pd-ai-message-text p {
  font-size: 14px !important;
}

/* Headers */
.pd-ai-message-text h1 {
  font-size: 16px !important;
  font-weight: 600 !important;
}

.pd-ai-message-text h2 {
  font-size: 15px !important;
  font-weight: 600 !important;
}

.pd-ai-message-text h3 {
  font-size: 14px !important;
  font-weight: 600 !important;
}

.pd-ai-message-text h4,
.pd-ai-message-text h5,
.pd-ai-message-text h6 {
  font-size: 14px !important;
  font-weight: 600 !important;
}

/* Lists */
.pd-ai-message-text ul,
.pd-ai-message-text ol {
  margin: 0 !important;
  padding: 3px 0 3px 20px !important;
  line-height: 1 !important;
}

.pd-ai-message-text li {
  font-size: 14px !important;
}

.pd-ai-message-text li p {
  display: inline !important;
  padding: 0 !important;
}

/* Nested lists */
.pd-ai-message-text li ul,
.pd-ai-message-text li ol {
  padding: 3px 0 3px 16px !important;
}

/* Bold text */
.pd-ai-message-text strong,
.pd-ai-message-text b {
  font-weight: 600 !important;
  color: #2c3e50 !important;
}

.pd-ai-user .pd-ai-message-text strong,
.pd-ai-user .pd-ai-message-text b {
  color: white !important;
}

/* Italic text */
.pd-ai-message-text em,
.pd-ai-message-text i {
  font-style: italic !important;
}

/* Inline code */
.pd-ai-message-text code {
  background: rgba(70, 130, 180, 0.1) !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
  font-family: 'Courier New', Courier, monospace !important;
  font-size: 12px !important;
  line-height: 1 !important;
  color: #4682b4 !important;
}

.pd-ai-user .pd-ai-message-text code {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

/* User message - all text white */
.pd-ai-user .pd-ai-message-text p,
.pd-ai-user .pd-ai-message-text h1,
.pd-ai-user .pd-ai-message-text h2,
.pd-ai-user .pd-ai-message-text h3,
.pd-ai-user .pd-ai-message-text h4,
.pd-ai-user .pd-ai-message-text h5,
.pd-ai-user .pd-ai-message-text h6,
.pd-ai-user .pd-ai-message-text li,
.pd-ai-user .pd-ai-message-text div,
.pd-ai-user .pd-ai-message-text span,
.pd-ai-user .pd-ai-message-text blockquote {
  color: white !important;
}

/* Code blocks */
.pd-ai-message-text pre {
  background: #f6f8fa !important;
  border: 1px solid #e1e4e8 !important;
  border-radius: 6px !important;
  padding: 6px 8px !important;
  margin: 3px 0 !important;
  overflow-x: auto !important;
  line-height: 1 !important;
}

.pd-ai-message-text pre code {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  color: #4682b4 !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

.pd-ai-user .pd-ai-message-text pre {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.pd-ai-user .pd-ai-message-text pre code {
  color: white !important;
}

/* Links */
.pd-ai-message-text a {
  color: #4682b4 !important;
  text-decoration: none !important;
  border-bottom: 1px solid transparent !important;
  transition: border-color 0.2s !important;
}

.pd-ai-message-text a:hover {
  border-bottom-color: #4682b4 !important;
}

.pd-ai-user .pd-ai-message-text a {
  color: white !important;
  border-bottom-color: rgba(255, 255, 255, 0.5) !important;
}

/* Blockquotes */
.pd-ai-message-text blockquote {
  margin: 3px 0 !important;
  padding: 3px 8px !important;
  border-left: 3px solid #4682b4 !important;
  background: rgba(70, 130, 180, 0.05) !important;
  font-style: italic !important;
  line-height: 1 !important;
}

.pd-ai-user .pd-ai-message-text blockquote {
  border-left-color: white !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Horizontal rules */
.pd-ai-message-text hr {
  margin: 3px 0 !important;
  border: none !important;
  border-top: 1px solid #ddd !important;
}

/* Line breaks */
.pd-ai-message-text br {
  line-height: 1 !important;
}

/* =================================== */
/* Markdown Tables - DataTable Style   */
/* =================================== */

.pd-table-wrapper {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  margin: 3px 0 !important;
  border-radius: 6px !important;
  border: 1px solid #ddd !important;
  position: relative !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Scrollbar for table wrapper */
.pd-table-wrapper::-webkit-scrollbar {
  height: 8px !important;
}

.pd-table-wrapper::-webkit-scrollbar-track {
  background: #f0f0f0 !important;
  border-radius: 4px !important;
}

.pd-table-wrapper::-webkit-scrollbar-thumb {
  background: #ccc !important;
  border-radius: 4px !important;
}

.pd-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #999 !important;
}

.pd-md-table {
  width: 100% !important;
  min-width: max-content !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
  line-height: 1 !important;
}

.pd-md-table thead {
  background: linear-gradient(135deg, #4682b4 0%, #5a9fd4 100%) !important;
  color: white !important;
}

.pd-md-table th {
  padding: 3px 8px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
  white-space: nowrap !important;
  border-bottom: 2px solid #3d7199 !important;
  text-align: left !important;
  color: white !important;
  background: linear-gradient(135deg, #4682b4 0%, #5a9fd4 100%) !important;
}

.pd-md-table tbody tr {
  border-bottom: 1px solid #eee !important;
  transition: background-color 0.15s ease !important;
}

.pd-md-table tbody tr:nth-child(even) {
  background: #f8f9fa !important;
}

.pd-md-table tbody tr:hover {
  background: rgba(70, 130, 180, 0.08) !important;
}

.pd-md-table td {
  padding: 3px 8px !important;
  white-space: nowrap !important;
  color: #2c3e50 !important;
  line-height: 1 !important;
}

/* First column sticky for wide tables */
.pd-md-table th:first-child,
.pd-md-table td:first-child {
  position: sticky !important;
  left: 0 !important;
  z-index: 1 !important;
}

.pd-md-table th:first-child {
  background: linear-gradient(135deg, #4682b4 0%, #5a9fd4 100%) !important;
}

.pd-md-table tbody tr:nth-child(odd) td:first-child {
  background: white !important;
}

.pd-md-table tbody tr:nth-child(even) td:first-child {
  background: #f8f9fa !important;
}

.pd-md-table tbody tr:hover td:first-child {
  background: rgba(70, 130, 180, 0.08) !important;
}

/* Document Badge Styles */
.pd-doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 6px;
  margin-bottom: 4px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.pd-doc-badge i {
  font-size: 10px;
}

/* Library badge - blue theme */
.pd-doc-badge-library {
  background: rgba(70, 130, 180, 0.1);
  color: #4682b4;
  border: 1px solid rgba(70, 130, 180, 0.2);
}

/* Folder badge - amber theme */
.pd-doc-badge-folder {
  background: rgba(255, 152, 0, 0.1);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.2);
}

/* Document badge - gray theme - clickable */
.pd-doc-badge-document {
  background: rgba(96, 125, 139, 0.1);
  color: #607d8b;
  border: 1px solid rgba(96, 125, 139, 0.2);
  cursor: pointer;
}

/* Score badge - green theme */
.pd-doc-badge-score {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

/* Hover effects for badges */
.pd-doc-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Meta container for badges */
.pd-ai-doc-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* NOTE: Document card styles removed from CSS - now applied as inline styles in JavaScript
   (slide_panel_frappe.js) for reliable application to dynamically generated content */

/* ============================================================================
   FRAPPE MODAL/SLIDE PANEL H2 STYLING - FIX FOR DOCUMENT PREVIEW
   ============================================================================
   These rules target H2 elements in Frappe modals/slide panels used for
   document preview. Applied globally to ensure consistent compact sizing.
   ============================================================================ */

/* Target H2 in Frappe modal bodies (slide panels, dialogs) */
.modal-body h2,
.frappe-control h2,
.form-layout h2,
body h2 {
  font-size: 14px !important;
  margin: 8px 0 4px 0 !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}

/* First H2 in container - remove top margin */
.modal-body h2:first-child,
.frappe-control h2:first-child,
.form-layout h2:first-child {
  margin-top: 0 !important;
}

/* H1 and H3 for consistency */
.modal-body h1,
.frappe-control h1,
.form-layout h1,
body h1 {
  font-size: 16px !important;
  margin: 8px 0 4px 0 !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}

.modal-body h3,
.frappe-control h3,
.form-layout h3,
body h3 {
  font-size: 13px !important;
  margin: 8px 0 4px 0 !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}

/* Override Frappe's desk.bundle media query that increases h2 size on larger screens */
@media (min-width: 768px) {
  .modal-body h2,
  .frappe-control h2,
  .form-layout h2,
  body h2,
  .page-content h2,
  .container h2 {
    font-size: 14px !important;
  }

  .modal-body h1,
  .frappe-control h1,
  .form-layout h1,
  body h1,
  .page-content h1,
  .container h1 {
    font-size: 16px !important;
  }

  .modal-body h3,
  .frappe-control h3,
  .form-layout h3,
  body h3,
  .page-content h3,
  .container h3 {
    font-size: 13px !important;
  }
}

