/* Navigation Tree Browser Styles */

/* Override base container width for this page */
body:has(.nav-browser-container) .container {
    max-width: 1600px;
    padding: 1.5rem;
}

/* Compact header for nav tree page */
body:has(.nav-browser-container) header {
    margin-bottom: 1.5rem;
}

body:has(.nav-browser-container) header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

body:has(.nav-browser-container) header p {
    font-size: 0.95rem;
    opacity: 0.85;
}

/* Override base button styles to not be full width */
.nav-browser-container button,
.filter-panel button,
.tree-view button,
.detail-panel button {
    width: auto;
}

/* Health Status Bar */
.health-status {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.health-status-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.health-icon {
    font-size: 1.1rem;
}

.health-text {
    font-weight: 500;
    font-size: 0.95rem;
}

.health-status.healthy {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.3);
}

.health-status.error {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
}

/* Main Container */
.nav-browser-container {
    display: grid;
    grid-template-columns: 280px 1fr 420px;
    gap: 1.5rem;
    margin-top: 1rem;
    min-height: calc(100vh - 280px);
}

/* Panel Base Styles */
.filter-panel,
.detail-panel {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    height: fit-content;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 1.5rem;
}

/* Detail Panel specific - more padding */
.detail-panel {
    padding: 1.5rem;
}

/* Filter Panel specific */
.filter-panel {
    font-size: 0.9rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid #e5e7eb;
}

.panel-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header h2 i {
    color: #6366f1;
    font-size: 1rem;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section h3 {
    margin: 0 0 0.75rem 0;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-section h3 i {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    min-height: auto;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: #6366f1;
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.filter-chip .remove-chip {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 0.7rem;
    opacity: 0.8;
    transition: opacity 0.15s ease;
    line-height: 1;
}

.filter-chip .remove-chip:hover {
    opacity: 1;
}

/* Tree Controls */
.tree-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.5rem 0.875rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-warning {
    background: #fbbf24;
    color: #92400e;
}

.btn-warning:hover {
    background: #f59e0b;
}

.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

/* Tree View */
.tree-view {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tree-view .panel-header {
    background: white;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #e5e7eb;
}

/* Tree Container */
.tree-container {
    background: white;
    border-radius: 0 0 12px 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    flex: 1;
}

.tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.tree-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Navigation Tree */
.tree,
.navigation-tree {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.tree-node {
    margin: 0.125rem 0;
    list-style: none;
}

.tree-node-content,
.node-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.tree-node-content:hover,
.node-content:hover {
    background: #f3f4f6;
}

.tree-node-content.selected,
.node-content.selected {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.tree-node-content.selected .tree-label,
.node-content.selected .node-label {
    font-weight: 600;
    color: #4338ca;
}

/* Tree toggle button */
.tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.15s ease;
    border-radius: 3px;
}

.tree-toggle:hover {
    background: #e5e7eb;
    color: #374151;
}

.tree-toggle i {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.tree-toggle.expanded i {
    transform: rotate(90deg);
}

/* Tree icon container */
.tree-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    background: #f0f4f8;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* SVG icon inside tree-icon */
.tree-icon .node-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Different backgrounds per node type for visual distinction */
.tab-node .tree-icon {
    background: #dbeafe;
    border-color: #93c5fd;
}

.app-node .tree-icon {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.quickaction_group-node .tree-icon {
    background: #fef3c7;
    border-color: #fcd34d;
}

.quickaction-node .tree-icon {
    background: #f3e8ff;
    border-color: #d8b4fe;
}

/* Tree label */
.tree-label,
.node-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
    font-size: 0.85rem;
}

/* Tree badge (stripe indicator) */
.tree-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.badge-hcm { background: #dbeafe; color: #1e40af; }
.badge-fin { background: #dcfce7; color: #166534; }
.badge-scm { background: #fef3c7; color: #92400e; }
.badge-cx { background: #fce7f3; color: #9d174d; }
.badge-tech { background: #e0e7ff; color: #4338ca; }

/* Framework badges */
.badge-vbcs {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: white;
    font-weight: 600;
}

.badge-redwood {
    background: linear-gradient(135deg, #dc2626, #ea580c);
    color: white;
    font-weight: 600;
}

.badge-mobile {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    font-weight: 600;
}

.badge-adf {
    background: #6b7280;
    color: white;
    font-weight: 500;
    font-size: 0.6rem;
}

/* VBCS node highlighting */
.vbcs-node > .tree-node-content {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.08), transparent);
    border-left: 2px solid #06b6d4;
}

.vbcs-node > .tree-node-content:hover {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), rgba(243, 244, 246, 0.5));
}

/* Redwood node highlighting */
.redwood-node > .tree-node-content {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.06), transparent);
    border-left: 2px solid #dc2626;
}

/* Mobile node highlighting */
.mobile-node > .tree-node-content {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.06), transparent);
    border-left: 2px solid #7c3aed;
}

/* Tree children container */
.tree-children {
    list-style: none;
    padding-left: 1rem;
    margin: 0;
    margin-left: 0.5rem;
    border-left: 1px solid #e5e7eb;
}

.tree-children.hidden {
    display: none;
}

/* Leaf nodes (no children) - no toggle space needed */
.tree-leaf > .tree-node-content .tree-toggle {
    visibility: hidden;
}

/* Detail Panel - inherits base styles from .filter-panel, .detail-panel rule */

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.detail-content {
    margin-top: 0.75rem;
}

.no-selection {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #6b7280;
}

.no-selection i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #d1d5db;
    display: block;
}

.no-selection h3 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
}

.no-selection p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Node Info Section */
.node-info-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.node-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.node-icon-large {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 10px;
    background: white;
    padding: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.node-icon-display {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.node-title {
    flex: 1;
    min-width: 0;
    padding-top: 0.25rem;
}

.node-title h3 {
    margin: 0 0 0.5rem 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.node-type-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-tab {
    background: #dbeafe;
    color: #1e40af;
}

.badge-app {
    background: #dcfce7;
    color: #166534;
}

.badge-quickaction_group {
    background: #fef3c7;
    color: #92400e;
}

.badge-quickaction {
    background: #f3f4f6;
    color: #374151;
}

/* Privileges Section */
.privileges-section {
    margin-bottom: 1.75rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid #e5e7eb;
}

.section-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h3 i {
    color: #6366f1;
    font-size: 0.85rem;
}

.privilege-count {
    background: #6366f1;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.privileges-loading {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.privileges-loading .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.privileges-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.privilege-item {
    padding: 0.875rem 1rem;
    margin-bottom: 0.625rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #6366f1;
    transition: background-color 0.15s ease;
}

.privilege-item:hover {
    background: #f3f4f6;
}

.privilege-item:last-child {
    margin-bottom: 0;
}

.privilege-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.8rem;
    line-height: 1.5;
    word-break: break-all;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
}

.privilege-code {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
}

.privilege-header {
    display: block;
    margin-bottom: 0.5rem;
}

.privilege-match-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.privilege-match-badge.match-exact {
    background: #dcfce7;
    color: #166534;
}

.privilege-match-badge.match-wildcard {
    background: #fef3c7;
    color: #92400e;
}

.privilege-match-badge.match-resource {
    background: #e0e7ff;
    color: #3730a3;
}

.privilege-match-badge.match-none {
    background: #f1f5f9;
    color: #64748b;
}

.privilege-resource-type {
    font-size: 0.7rem;
    color: #6366f1;
    font-weight: 600;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.privilege-resource {
    font-size: 0.75rem;
    color: #64748b;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
    word-break: break-all;
    line-height: 1.45;
    background: #f1f5f9;
    padding: 0.5rem 0.625rem;
    border-radius: 4px;
    margin-top: 0.25rem;
}

.privilege-score {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 0.375rem;
    font-weight: 500;
}

.no-privileges,
.no-roles {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #9ca3af;
    font-style: italic;
    font-size: 0.875rem;
}

/* Roles Section */
.roles-section {
    margin-bottom: 1.75rem;
}

.role-count {
    background: #10b981;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.roles-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    color: #6b7280;
}

.roles-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.role-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #f0fdf4;
    border-radius: 8px;
    border-left: 3px solid #10b981;
    transition: background-color 0.15s ease;
}

.role-item:hover {
    background: #dcfce7;
}

.role-item:last-child {
    margin-bottom: 0;
}

.role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.role-name {
    font-weight: 600;
    color: #166534;
    font-size: 0.85rem;
    line-height: 1.4;
}

.role-priv-count {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    background: #bbf7d0;
    color: #166534;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.role-code {
    font-size: 0.7rem;
    color: #6b7280;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
    word-break: break-all;
}

/* Role Category Cards */
.role-category-card {
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: white;
}

.role-category-card.seeded-roles-card {
    border-left: 4px solid #3b82f6;
}

.role-category-card.custom-roles-card {
    border-left: 4px solid #f59e0b;
}

.role-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.role-category-card.seeded-roles-card .role-category-header {
    background: #eff6ff;
    border-bottom-color: #dbeafe;
}

.role-category-card.custom-roles-card .role-category-header {
    background: #fffbeb;
    border-bottom-color: #fef3c7;
}

.role-category-header i {
    font-size: 0.9rem;
    color: #6b7280;
}

.role-category-card.seeded-roles-card .role-category-header i {
    color: #3b82f6;
}

.role-category-card.custom-roles-card .role-category-header i {
    color: #f59e0b;
}

.role-category-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    flex: 1;
}

.role-category-count {
    background: #e5e7eb;
    color: #374151;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.role-category-card.seeded-roles-card .role-category-count {
    background: #dbeafe;
    color: #1e40af;
}

.role-category-card.custom-roles-card .role-category-count {
    background: #fef3c7;
    color: #92400e;
}

.role-category-list {
    padding: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.role-category-card .role-item {
    margin-bottom: 0.375rem;
    padding: 0.625rem 0.875rem;
}

.role-category-card.seeded-roles-card .role-item {
    background: #eff6ff;
    border-left-color: #3b82f6;
}

.role-category-card.seeded-roles-card .role-item:hover {
    background: #dbeafe;
}

.role-category-card.seeded-roles-card .role-name {
    color: #1e40af;
}

.role-category-card.custom-roles-card .role-item {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.role-category-card.custom-roles-card .role-item:hover {
    background: #fef3c7;
}

.role-category-card.custom-roles-card .role-name {
    color: #92400e;
}

/* Node Properties Section */
.node-properties-section {
    margin-bottom: 1.5rem;
}

.collapsible {
    cursor: pointer;
}

.collapsible .section-header {
    cursor: pointer;
    transition: background-color 0.15s ease;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem 0 -0.5rem;
    border-radius: 6px;
}

.collapsible .section-header:hover {
    background: #f3f4f6;
}

.toggle-icon {
    transition: transform 0.2s ease;
    color: #9ca3af;
    font-size: 0.75rem;
}

.collapsible.expanded .toggle-icon {
    transform: rotate(180deg);
}

.properties-content {
    margin-top: 0.75rem;
}

.properties-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.properties-table th,
.properties-table td {
    padding: 0.5rem 0.625rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.properties-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.properties-table td {
    color: #6b7280;
}

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

/* Filter Chips Container */
.filter-chips-container {
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.filter-chips-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.filter-chips-header i {
    font-size: 0.7rem;
}

.no-filters {
    padding: 0.5rem;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    font-size: 0.8rem;
}

/* Tree Actions */
.tree-actions {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

/* Loading States */
.tree-loading {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}

.tree-loading .spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.tree-loading p {
    font-size: 0.875rem;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Small spinner for loading states */
.spinner.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab.active {
    border-bottom-color: #007bff;
    color: #007bff;
    font-weight: 500;
}

.tab:hover:not(.active) {
    background: #f8f9fa;
}

.tab-content {
    padding: 1rem 0;
}

/* Form Elements */
.filter-select, .search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    color: #374151;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-select:focus, .search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-input {
    padding-left: 2.25rem;
}

.tab-search-container {
    position: relative;
    margin-bottom: 0.75rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Slider */
.slider-container {
    margin-bottom: 0.5rem;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.375rem;
    font-size: 0.7rem;
    color: #9ca3af;
}

.slider-labels span:nth-child(2) {
    font-weight: 600;
    color: #6366f1;
}

.slider-container small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.7rem;
    color: #9ca3af;
}

/* Tab Controls */
.tab-controls {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
}

.tab-count {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 0.375rem 0.5rem;
    background: #f3f4f6;
    border-radius: 4px;
}

.tab-count i {
    color: #9ca3af;
    font-size: 0.7rem;
}

.tabs-container {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.375rem;
    background: #fafafa;
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    margin-bottom: 0.125rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.8rem;
}

.tab-item:hover {
    background: #f3f4f6;
}

.tab-item.selected {
    background: #eef2ff;
    color: #4338ca;
}

.tab-item:last-child {
    margin-bottom: 0;
}

.tab-checkbox {
    margin: 0;
    accent-color: #6366f1;
}

.loading-tabs {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    font-size: 0.8rem;
    padding: 1rem;
}

/* Statistics */
.stats {
    display: grid;
    gap: 0.375rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.625rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #f3f4f6;
}

.stat-label {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.8rem;
}

.stat-value {
    color: #6366f1;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Search Results */
.search-results {
    background: #f9fafb;
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.75rem;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.search-result-item:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-label {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.85rem;
}

.search-result-path {
    font-size: 0.7rem;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-type {
    font-size: 0.65rem;
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .nav-browser-container {
        grid-template-columns: 260px 1fr 340px;
        gap: 1rem;
    }
}

@media (max-width: 1200px) {
    .nav-browser-container {
        grid-template-columns: 240px 1fr 320px;
        gap: 1rem;
    }

    body:has(.nav-browser-container) .container {
        padding: 1rem;
    }
}

@media (max-width: 992px) {
    .nav-browser-container {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .filter-panel {
        grid-column: 1 / -1;
        position: static;
        max-height: none;
    }

    .tree-container, .detail-panel {
        max-height: 60vh;
    }
}

@media (max-width: 768px) {
    .nav-browser-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filter-panel,
    .detail-panel {
        position: static;
        max-height: none;
    }

    .tree-container {
        max-height: 50vh;
    }

    .tree-actions {
        flex-wrap: wrap;
    }

    .tree-actions .btn {
        flex: 1 1 auto;
        min-width: 80px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6b7280 !important;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* Error Display */
.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.error-content {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.error-content > i {
    color: #dc2626;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.error-content h3 {
    margin: 0 0 0.25rem 0;
    color: #991b1b;
    font-size: 0.95rem;
    font-weight: 600;
}

.error-content p {
    margin: 0;
    color: #dc2626;
    font-size: 0.875rem;
}

.error-content .btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* Footer */
footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

footer p {
    margin: 0.25rem 0;
}

.footer-info {
    font-size: 0.75rem;
    opacity: 0.7;
}

.status-indicator {
    font-weight: 500;
}

/* Scrollbar Styling */
.filter-panel::-webkit-scrollbar,
.tree-container::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar,
.tabs-container::-webkit-scrollbar,
.privileges-list::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
    width: 6px;
}

.filter-panel::-webkit-scrollbar-track,
.tree-container::-webkit-scrollbar-track,
.detail-panel::-webkit-scrollbar-track,
.tabs-container::-webkit-scrollbar-track,
.privileges-list::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.filter-panel::-webkit-scrollbar-thumb,
.tree-container::-webkit-scrollbar-thumb,
.detail-panel::-webkit-scrollbar-thumb,
.tabs-container::-webkit-scrollbar-thumb,
.privileges-list::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.filter-panel::-webkit-scrollbar-thumb:hover,
.tree-container::-webkit-scrollbar-thumb:hover,
.detail-panel::-webkit-scrollbar-thumb:hover,
.tabs-container::-webkit-scrollbar-thumb:hover,
.privileges-list::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}


/* ============================================================================
   TOGGLE SWITCH STYLES
   ============================================================================ */

.toggle-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.toggle-option:last-child {
    border-bottom: none;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    cursor: pointer;
}

.toggle-label span {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.toggle-label small {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: normal;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #2563eb;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* ============================================================================
   TREE SEARCH BAR STYLES
   ============================================================================ */

.tree-search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    margin: -1.25rem -1.25rem 0 -1.25rem;
    margin-bottom: 1rem;
}

.tree-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.tree-search-icon {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    font-size: 0.9rem;
    pointer-events: none;
}

.tree-search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tree-search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tree-search-input::placeholder {
    color: #9ca3af;
}

.tree-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.tree-search-clear:hover {
    color: #374151;
    background: #f3f4f6;
}

.tree-search-results-count {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    padding: 0.375rem 0.75rem;
    background: #e5e7eb;
    border-radius: 12px;
}

.tree-search-results-count span {
    font-weight: 600;
    color: #2563eb;
}

/* Tree node search highlight */
.tree-node.search-match > .tree-node-content {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.tree-node.search-match > .tree-node-content .tree-label {
    font-weight: 600;
    color: #92400e;
}

/* Search highlight text */
.search-highlight {
    background: #fde047;
    padding: 0 2px;
    border-radius: 2px;
}
