/*******************************************************************************
*
*   H.Builder 7.0.0 - hSentinel Intelligence Fusion Platform
*   Copyright (c) 2026 Hagimo, LLC
*
*   Dark theme -- federal/defense/IC styling conventions.
*   Inspired by Palantir Blueprint, USWDS, and IC design patterns.
*
*******************************************************************************/

/* =============================================================================
   CSS Variables - Federal Dark Theme
   ============================================================================= */
:root {
	/* Primary Colors - Blueprint Blue */
	--hb-primary: #2D72D2;
	--hb-primary-light: #4C90F0;
	--hb-primary-dark: #1A4480;

	/* Dark Colors - Blue-gray surfaces (Blueprint palette) */
	--hb-dark: #1C2127;
	--hb-dark-light: #383E47;
	--hb-dark-darker: #111418;

	/* Accent Colors */
	--hb-accent: #2D72D2;
	--hb-accent-hover: #215DB0;
	--hb-accent-light: #4C90F0;

	/* Status Colors */
	--hb-success: #238551;
	--hb-success-light: #32A467;
	--hb-warning: #C87619;
	--hb-warning-light: #EC9A3C;
	--hb-danger: #CD4246;
	--hb-danger-light: #E76A6E;
	--hb-info: #2D72D2;

	/* Neutral Colors - Dark Theme (lightest = text, darkest = bg) */
	--hb-white: #F6F7F9;
	--hb-gray-50: #2F343C;
	--hb-gray-100: #252A31;
	--hb-gray-200: #404854;
	--hb-gray-300: #5F6B7C;
	--hb-gray-400: #738091;
	--hb-gray-500: #ABB3BF;
	--hb-gray-600: #C5CBD3;
	--hb-gray-700: #DCE0E5;
	--hb-gray-800: #EDEFF2;
	--hb-gray-900: #F6F7F9;
	--hb-black: #000000;

	/* Background Colors - Dark */
	--hb-body-bg: #1C2127;
	--hb-card-bg: #252A31;
	--hb-card-border: #404854;
	--hb-header-bg: #2F343C;

	/* Typography - 25% larger, federal font stack */
	--hb-font-family: 'Inter', 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
	--hb-font-mono: 'Roboto Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
	--hb-font-size-xs: 13px;
	--hb-font-size-sm: 14px;
	--hb-font-size-base: 15px;
	--hb-font-size-md: 16px;
	--hb-font-size-lg: 18px;
	--hb-font-size-xl: 20px;
	--hb-font-size-2xl: 22px;
	--hb-font-size-3xl: 28px;

	/* Spacing - 8px grid system */
	--hb-space-xs: 4px;
	--hb-space-sm: 8px;
	--hb-space-md: 12px;
	--hb-space-lg: 16px;
	--hb-space-xl: 24px;
	--hb-space-2xl: 32px;

	/* Border Radius - Tactical/sharp */
	--hb-radius-sm: 3px;
	--hb-radius-md: 4px;
	--hb-radius-lg: 6px;
	--hb-radius-xl: 8px;
	--hb-radius-full: 9999px;

	/* Shadows - Dark theme appropriate */
	--hb-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
	--hb-shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4);
	--hb-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
	--hb-shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.5);

	/* Transitions */
	--hb-transition-fast: 100ms ease;
	--hb-transition-normal: 200ms ease;
	--hb-transition-slow: 300ms ease;
}

/* =============================================================================
   Reset & Base Styles
   ============================================================================= */
*, *::before, *::after {
	box-sizing: border-box;
}

html {
	font-size: var(--hb-font-size-base);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-base);
	line-height: 1.4;
	color: var(--hb-gray-800);
	background: var(--hb-body-bg);
}

/* =============================================================================
   Typography - Compact
   ============================================================================= */
h1, h2, h3, h4, h5, h6 {
	margin: 0 0 var(--hb-space-xs) 0;
	font-weight: 600;
	line-height: 1.2;
	color: var(--hb-gray-800);
}

h1 { font-size: var(--hb-font-size-2xl); }
h2 { font-size: var(--hb-font-size-xl); }
h3 { font-size: var(--hb-font-size-lg); }
h4 { 
	font-size: var(--hb-font-size-sm); 
	color: var(--hb-primary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 1px solid var(--hb-gray-200);
	padding-bottom: 3px;
	margin-bottom: var(--hb-space-sm);
}

p {
	margin: 0 0 var(--hb-space-xs) 0;
}

a {
	color: var(--hb-primary);
	text-decoration: none;
	transition: color var(--hb-transition-fast);
}

a:hover {
	color: var(--hb-primary-dark);
	text-decoration: none;
}

/* =============================================================================
   Page Header - Compact
   ============================================================================= */
.hb-page-header {
	background: var(--hb-header-bg);
	border-bottom: 1px solid var(--hb-card-border);
	color: var(--hb-gray-800);
	padding: var(--hb-space-md) var(--hb-space-lg);
	margin-bottom: var(--hb-space-md);
}

.hb-page-header h1 {
	margin: 0;
	font-size: var(--hb-font-size-lg);
	font-weight: 600;
	color: var(--hb-gray-800);
	display: flex;
	align-items: center;
	gap: var(--hb-space-sm);
}

.hb-page-header h1 .hb-icon {
	opacity: 0.9;
}

.hb-page-subtitle {
	margin: 2px 0 0 0;
	font-size: var(--hb-font-size-xs);
	color: var(--hb-gray-500);
}

/* =============================================================================
   Cards - Dark & Compact
   ============================================================================= */
.hb-card {
	background: var(--hb-card-bg);
	border: 1px solid var(--hb-card-border);
	border-radius: var(--hb-radius-md);
	overflow: hidden;
}

.hb-card-header {
	background: var(--hb-gray-50);
	border-bottom: 1px solid var(--hb-card-border);
	padding: var(--hb-space-sm) var(--hb-space-md);
	font-weight: 600;
	font-size: var(--hb-font-size-sm);
	color: var(--hb-gray-800);
	display: flex;
	align-items: center;
	gap: var(--hb-space-sm);
}

.hb-card-header .hb-icon {
	color: var(--hb-primary);
}

.hb-card-body {
	padding: var(--hb-space-md);
}

.hb-card-footer {
	background: var(--hb-gray-50);
	border-top: 1px solid var(--hb-card-border);
	padding: var(--hb-space-sm) var(--hb-space-md);
}

/* Card Variants */
.hb-card-warning {
	border-color: var(--hb-warning);
}

.hb-card-warning .hb-card-header {
	background: rgba(200, 118, 25, 0.2);
	color: var(--hb-warning-light);
}

.hb-card-danger {
	border-color: var(--hb-danger);
}

.hb-card-danger .hb-card-header {
	background: rgba(205, 66, 70, 0.2);
	color: var(--hb-danger-light);
}

/* =============================================================================
   Layout Containers - Compact
   ============================================================================= */
.hb-container {
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 var(--hb-space-md);
}

.hb-main-content {
	padding: var(--hb-space-md);
}

.hb-grid {
	display: grid;
	gap: var(--hb-space-md);
}

.hb-grid-2 {
	grid-template-columns: repeat(2, 1fr);
}

.hb-grid-3 {
	grid-template-columns: repeat(3, 1fr);
}

.hb-grid-sidebar {
	grid-template-columns: 260px minmax(200px, 1fr);
}

.hb-grid-licenses {
	grid-template-columns: 280px minmax(400px, 1fr);
}

.hb-flex {
	display: flex;
}

.hb-flex-col {
	flex-direction: column;
}

.hb-flex-wrap {
	flex-wrap: wrap;
}

.hb-items-center {
	align-items: center;
}

.hb-items-start {
	align-items: flex-start;
}

.hb-justify-between {
	justify-content: space-between;
}

.hb-justify-center {
	justify-content: center;
}

.hb-justify-end {
	justify-content: flex-end;
}

.hb-gap-xs { gap: var(--hb-space-xs); }
.hb-gap-sm { gap: var(--hb-space-sm); }
.hb-gap-md { gap: var(--hb-space-md); }
.hb-gap-lg { gap: var(--hb-space-lg); }

/* =============================================================================
   Form Elements - Dark & Compact
   ============================================================================= */
.hb-form-group {
	margin-bottom: var(--hb-space-sm);
}

.hb-form-row {
	display: flex;
	align-items: center;
	gap: var(--hb-space-sm);
	margin-bottom: var(--hb-space-xs);
}

.hb-form-row.hb-compact {
	margin-bottom: 2px;
}

.hb-form-row-inline {
	display: flex;
	align-items: center;
	gap: var(--hb-space-sm);
	margin-bottom: var(--hb-space-xs);
}

.hb-form-row-inline input[type="text"],
.hb-form-row-inline input[type="date"],
.hb-form-row-inline input[type="email"],
.hb-form-row-inline select {
	flex: 1;
}

.hb-form-row-inline .hb-text-mono {
	flex: 1;
	min-width: 0;
}

.hb-label-fixed {
	display: inline-block;
	min-width: 100px;
	font-size: var(--hb-font-size-xs);
	font-weight: 500;
	color: var(--hb-gray-600);
	text-align: right;
	flex-shrink: 0;
}

.hb-limits-grid {
	display: flex;
	flex-direction: column;
	gap: var(--hb-space-xs);
}

.hb-label {
	display: block;
	font-size: var(--hb-font-size-xs);
	font-weight: 500;
	color: var(--hb-gray-600);
	margin-bottom: 2px;
}

.hb-label-inline {
	min-width: 80px;
	text-align: right;
	margin-bottom: 0;
	flex-shrink: 0;
}

.hb-label-wide {
	min-width: 100px;
}

/* Input Base Styles - Dark Theme */
.hb-input,
.hb-select,
.hb-textarea,
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-sm);
	padding: 6px 10px;
	border: 1px solid var(--hb-gray-200);
	border-radius: var(--hb-radius-sm);
	background: #1C2127;
	color: var(--hb-gray-800);
	transition: border-color var(--hb-transition-fast), box-shadow var(--hb-transition-fast);
	outline: none;
	width: 100%;
}

.hb-input:hover,
.hb-select:hover,
.hb-textarea:hover,
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
textarea:hover,
select:hover {
	border-color: var(--hb-gray-400);
}

.hb-input:focus,
.hb-select:focus,
.hb-textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
	border-color: var(--hb-primary);
	box-shadow: 0 0 0 2px rgba(45, 114, 210, 0.3);
}

/* Input Sizes */
input.hb-input-xs, .hb-input-xs { width: 30px; }
input.hb-input-sm, .hb-input-sm { width: 50px; }
input.hb-input-md, .hb-input-md { width: 100px; }
input.hb-input-lg, .hb-input-lg { width: 160px; }
input.hb-input-xl, .hb-input-xl { width: 240px; }
input.hb-input-full, .hb-input-full { width: 100%; }

/* Form helper classes for ex.* functions */
input.form_text_2 { width: 30px; }
input.form_text_4 { width: 40px; }
input.form_text_6 { width: 50px; }
input.form_text_10 { width: 130px; }
input.form_text_m { width: 200px; }
input.form_text_l { width: 260px; }
input.form_text_l2 { width: 320px; }

/* Select Styling - Dark */
.hb-select,
select {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23ABB3BF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-color: #1C2127;
	padding-right: 28px;
}

/* Multi-select - Dark */
.hb-select-multi,
select[multiple] {
	background-image: none;
	padding-right: var(--hb-space-sm);
	min-height: 120px;
}

select[multiple] option {
	padding: 4px 8px;
	border-bottom: 1px solid var(--hb-gray-200);
}

select[multiple] option:checked {
	background: var(--hb-accent);
	color: #F6F7F9;
}

/* Textarea */
.hb-textarea,
textarea {
	min-height: 60px;
	resize: vertical;
}

/* Radio & Checkbox Groups */
.hb-radio-group,
.hb-checkbox-group {
	display: flex;
	gap: var(--hb-space-md);
	align-items: center;
}

.hb-radio-label,
.hb-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: var(--hb-font-size-xs);
	color: var(--hb-gray-700);
	cursor: pointer;
}

.hb-radio-label input,
.hb-checkbox-label input {
	width: auto;
	margin: 0;
	cursor: pointer;
}

/* =============================================================================
   Buttons - Compact
   ============================================================================= */
.hb-btn,
input[type="button"],
input[type="submit"],
.buttons,
.buttons_s,
.buttons_tiny,
.buttons_w2,
.buttons_w3 {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 2px;
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-xs);
	font-weight: 500;
	padding: 3px 8px;
	border: 1px solid transparent;
	border-radius: var(--hb-radius-sm);
	cursor: pointer;
	transition: all var(--hb-transition-fast);
	text-decoration: none;
	white-space: nowrap;
	background: var(--hb-accent);
	color: var(--hb-white);
}

.hb-btn:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.buttons:hover,
.buttons_s:hover,
.buttons_tiny:hover,
.buttons_w2:hover,
.buttons_w3:hover {
	background: var(--hb-accent-hover);
	transform: translateY(-1px);
	box-shadow: var(--hb-shadow-sm);
}

.hb-btn:active,
input[type="button"]:active,
input[type="submit"]:active {
	transform: translateY(0);
}

/* Button Variants */
.hb-btn-primary {
	background: var(--hb-accent);
	color: var(--hb-white);
}

.hb-btn-secondary {
	background: var(--hb-gray-200);
	color: var(--hb-gray-700);
	border-color: var(--hb-gray-300);
}

.hb-btn-secondary:hover {
	background: var(--hb-gray-300);
}

.hb-btn-success {
	background: var(--hb-success);
	color: var(--hb-white);
}

.hb-btn-success:hover {
	background: var(--hb-success-light);
}

.hb-btn-warning {
	background: var(--hb-warning);
	color: var(--hb-white);
}

.hb-btn-warning:hover {
	background: var(--hb-warning-light);
}

.hb-btn-danger {
	background: var(--hb-danger);
	color: var(--hb-white);
}

.hb-btn-danger:hover {
	background: var(--hb-danger-light);
}

.hb-btn-outline {
	background: transparent;
	border: 1px solid var(--hb-gray-300);
	color: var(--hb-gray-600);
}

.hb-btn-outline:hover {
	background: var(--hb-gray-100);
	border-color: var(--hb-gray-400);
}

/* Button Sizes */
.hb-btn-xs {
	font-size: 9px;
	padding: 1px 4px;
}

.hb-btn-sm,
.buttons_tiny,
.buttons_s {
	font-size: var(--hb-font-size-xs);
	padding: 2px 5px;
}

.hb-btn-lg {
	font-size: var(--hb-font-size-sm);
	padding: 5px 12px;
}

.buttons_w2,
.buttons_w3 {
	min-width: 100px;
}

/* Disabled Button State */
.hb-btn:disabled,
.hb-btn[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
	pointer-events: none;
}

/* Button Groups */
.hb-btn-group {
	display: flex;
	gap: var(--hb-space-xs);
	flex-wrap: wrap;
}

.hb-btn-group-right {
	justify-content: flex-end;
}

.hb-btn-group-center {
	justify-content: center;
}

/* =============================================================================
   Search Results / List Box - Dark Theme
   ============================================================================= */
.hb-listbox,
.UsersSearchResults,
.Users_GroupsList {
	width: 100%;
	min-height: 120px;
	border: 1px solid var(--hb-gray-200);
	border-radius: var(--hb-radius-sm);
	background: #1C2127;
	font-family: var(--hb-font-mono);
	font-size: var(--hb-font-size-xs);
	overflow-y: auto;
	color: var(--hb-gray-800);
}

.hb-listbox option,
.UsersSearchResults option,
.Users_GroupsList option {
	padding: 2px 6px;
	border-bottom: 1px solid var(--hb-gray-200);
	cursor: pointer;
	transition: background var(--hb-transition-fast);
}

.hb-listbox option:hover,
.UsersSearchResults option:hover,
.Users_GroupsList option:hover {
	background: var(--hb-gray-100);
}

.hb-listbox option:checked,
.UsersSearchResults option:checked,
.Users_GroupsList option:checked {
	background: var(--hb-primary);
	color: var(--hb-white);
}

.UsersSearchResults {
	min-height: 140px;
}

.Users_GroupsList {
	min-height: 160px;
}

/* =============================================================================
   Search Box - Compact
   ============================================================================= */
.hb-search-box {
	display: flex;
	gap: var(--hb-space-xs);
}

.hb-search-box input {
	flex: 1;
}

.hb-search-box .hb-btn {
	flex-shrink: 0;
}

/* =============================================================================
   Section Divider - Dark
   ============================================================================= */
.hb-divider {
	height: 1px;
	background: var(--hb-gray-200);
	margin: var(--hb-space-md) 0;
}

.hb-divider-sm {
	height: 1px;
	background: var(--hb-gray-200);
	margin: var(--hb-space-sm) 0;
}

.hb-divider-vertical {
	width: 1px;
	height: auto;
	align-self: stretch;
	background: var(--hb-gray-200);
	margin: 0 var(--hb-space-md);
}

/* Section Title - Compact */
.hb-section-title {
	font-size: var(--hb-font-size-xs);
	font-weight: 600;
	color: var(--hb-primary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin: 0 0 var(--hb-space-xs) 0;
	padding-bottom: 2px;
	border-bottom: 1px solid var(--hb-gray-200);
}

/* Monospace text */
.hb-text-mono {
	font-family: var(--hb-font-mono);
	word-break: break-all;
	overflow-wrap: break-word;
}

/* Small select for dropdowns in forms */
.hb-select-sm {
	padding: 3px 6px;
	font-size: var(--hb-font-size-sm);
	border-radius: var(--hb-radius-sm);
	border: 1px solid var(--hb-gray-300);
	background: #1C2127;
	color: var(--hb-gray-800);
	min-width: 120px;
}

/* =============================================================================
   Status Indicators - Dark
   ============================================================================= */
.hb-badge {
	display: inline-flex;
	align-items: center;
	padding: 1px 6px;
	font-size: var(--hb-font-size-xs);
	font-weight: 500;
	border-radius: var(--hb-radius-full);
	background: var(--hb-gray-200);
	color: var(--hb-gray-700);
}

.hb-badge-success {
	background: var(--hb-success);
	color: var(--hb-white);
}

.hb-badge-warning {
	background: var(--hb-warning);
	color: var(--hb-gray-900);
}

.hb-badge-danger {
	background: var(--hb-danger);
	color: var(--hb-white);
}

.hb-badge-info {
	background: var(--hb-primary);
	color: var(--hb-white);
}

/* =============================================================================
   Tables - Dark & Compact
   ============================================================================= */
.hb-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--hb-font-size-xs);
}

.hb-table th,
.hb-table td {
	padding: 3px 6px;
	text-align: left;
	border-bottom: 1px solid var(--hb-gray-200);
}

.hb-table th {
	background: var(--hb-gray-50);
	font-weight: 600;
	color: var(--hb-gray-600);
}

.hb-table tr:hover td {
	background: var(--hb-gray-50);
}

/* Legacy table support */
table.dotted {
	border: 1px dashed var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	border-spacing: 0;
	border-collapse: separate;
	overflow: hidden;
}

td.admin_td_header {
	background: var(--hb-gray-50);
	padding: 2px 6px;
	font-weight: 600;
	color: var(--hb-gray-600);
	border-bottom: 1px solid var(--hb-gray-200);
}

td.BlueBar {
	background: var(--hb-primary);
	height: 2px;
	padding: 0;
}

/* =============================================================================
   Alerts & Messages - Dark Theme
   ============================================================================= */
.hb-alert {
	padding: var(--hb-space-sm) var(--hb-space-md);
	border-radius: var(--hb-radius-sm);
	margin-bottom: var(--hb-space-sm);
	border-left: 3px solid;
	font-size: var(--hb-font-size-xs);
}

.hb-alert-info {
	background: rgba(45, 114, 210, 0.15);
	border-color: var(--hb-primary);
	color: var(--hb-primary-light);
}

.hb-alert-success {
	background: rgba(35, 133, 81, 0.15);
	border-color: var(--hb-success);
	color: var(--hb-success-light);
}

.hb-alert-warning {
	background: rgba(200, 118, 25, 0.15);
	border-color: var(--hb-warning);
	color: var(--hb-warning-light);
}

.hb-alert-danger {
	background: rgba(205, 66, 70, 0.15);
	border-color: var(--hb-danger);
	color: var(--hb-danger-light);
}

/* =============================================================================
   IFrame / Debug Panel - Dark
   ============================================================================= */
.hb-debug-frame {
	border: 1px solid var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	background: var(--hb-card-bg);
	margin-top: var(--hb-space-md);
}

.hb-debug-frame-hidden {
	height: 1px;
	border: none;
	overflow: hidden;
}

/* =============================================================================
   Help Text - Dark
   ============================================================================= */
.hb-help-text {
	font-size: var(--hb-font-size-xs);
	color: var(--hb-gray-500);
	margin-top: var(--hb-space-xs);
	line-height: 1.4;
}

.hb-help-text strong {
	color: var(--hb-gray-700);
}

/* =============================================================================
   No Access Panel - Dark
   ============================================================================= */
.hb-no-access {
	text-align: center;
	padding: var(--hb-space-xl);
}

.hb-no-access-icon {
	font-size: 48px;
	color: var(--hb-danger);
	margin-bottom: var(--hb-space-md);
}

.hb-no-access h2 {
	color: var(--hb-danger);
}

/* =============================================================================
   Utility Classes - Dark Theme
   ============================================================================= */
.hb-text-center { text-align: center; }
.hb-text-right { text-align: right; }
.hb-text-left { text-align: left; }

.hb-text-sm { font-size: var(--hb-font-size-sm); }
.hb-text-xs { font-size: var(--hb-font-size-xs); }
.hb-text-lg { font-size: var(--hb-font-size-lg); }

.hb-text-muted { color: var(--hb-gray-500); }
.hb-text-success { color: var(--hb-success); }
.hb-text-warning { color: var(--hb-warning); }
.hb-text-danger { color: var(--hb-danger); }

.hb-font-bold { font-weight: 600; }
.hb-font-mono { font-family: var(--hb-font-mono); }

.hb-mt-0 { margin-top: 0; }
.hb-mt-xs { margin-top: var(--hb-space-xs); }
.hb-mt-sm { margin-top: var(--hb-space-sm); }
.hb-mt-md { margin-top: var(--hb-space-md); }
.hb-mt-lg { margin-top: var(--hb-space-lg); }

.hb-mb-0 { margin-bottom: 0; }
.hb-mb-sm { margin-bottom: var(--hb-space-sm); }
.hb-mb-md { margin-bottom: var(--hb-space-md); }
.hb-mb-lg { margin-bottom: var(--hb-space-lg); }

.hb-ml-sm { margin-left: var(--hb-space-sm); }
.hb-ml-md { margin-left: var(--hb-space-md); }

.hb-p-0 { padding: 0; }
.hb-p-sm { padding: var(--hb-space-sm); }
.hb-p-md { padding: var(--hb-space-md); }
.hb-p-lg { padding: var(--hb-space-lg); }

.hb-w-full { width: 100%; }
.hb-h-full { height: 100%; }

.hb-hidden { display: none; }
.hb-visible { display: block; }

/* =============================================================================
   Menu Styles (Legacy Support) - Dark
   ============================================================================= */
ul#menu-v, #menu-v ul {
	width: 140px;
	border: 1px solid var(--hb-gray-200);
	border-radius: var(--hb-radius-sm);
	list-style: none;
	margin: 0;
	padding: 0;
	z-index: 9;
	background: var(--hb-card-bg);
	box-shadow: var(--hb-shadow-md);
}

#menu-v li {
	margin: 0;
	padding: 0;
	position: relative;
	background: var(--hb-card-bg);
	transition: background var(--hb-transition-fast);
}

#menu-v li:hover {
	background: var(--hb-gray-100);
}

#menu-v a {
	font-weight: 500;
	font-size: var(--hb-font-size-xs);
	border-top: 1px solid var(--hb-gray-200);
	display: block;
	color: var(--hb-gray-700);
	text-decoration: none;
	text-align: right;
	line-height: 24px;
	padding: 0 var(--hb-space-sm);
	position: relative;
}

#menu-v li:first-child a {
	border-top: 0;
}

#menu-v a.arrow::after {
	content: '';
	position: absolute;
	display: inline;
	top: 50%;
	right: 6px;
	border-width: 3px;
	border-style: solid;
	border-color: transparent transparent transparent var(--hb-gray-400);
	transition: border-color var(--hb-transition-fast);
}

#menu-v li a.arrow:hover::after {
	border-color: transparent transparent transparent var(--hb-primary);
}

#menu-v li ul {
	min-width: 140px;
	position: absolute;
	display: none;
	left: 100%;
	top: 0;
}

#menu-v li:hover > ul {
	display: block;
}

/* =============================================================================
   Auditing Styles - Dark
   ============================================================================= */
td.AuditingSplash {
	border: 1px solid var(--hb-warning);
	background: rgba(200, 118, 25, 0.1);
	padding: var(--hb-space-sm);
	color: var(--hb-gray-700);
	font-size: var(--hb-font-size-xs);
	border-radius: var(--hb-radius-sm);
}

td.td_Audit_Simple_Header {
	border: 1px solid var(--hb-gray-200);
	background: var(--hb-gray-50);
	padding: 2px 6px;
	font-weight: 600;
	color: var(--hb-gray-600);
}

a.Auditing {
	color: var(--hb-gray-700);
	text-decoration: none;
}

a.Auditing:hover {
	color: var(--hb-primary);
	text-decoration: underline;
}

/* =============================================================================
   Alerts Link Styles
   ============================================================================= */
a.Alerts {
	color: var(--hb-white);
	text-decoration: none;
}

a.Alerts:hover {
	text-decoration: underline;
}

/* =============================================================================
   Code Blocks - Dark
   ============================================================================= */
code {
	display: block;
	background: var(--hb-gray-50);
	border: 1px solid var(--hb-gray-200);
	color: var(--hb-gray-800);
	padding: var(--hb-space-sm);
	white-space: pre;
	font-family: var(--hb-font-mono);
	font-size: var(--hb-font-size-xs);
	border-radius: var(--hb-radius-sm);
	overflow-x: auto;
}

/* =============================================================================
   Splash Text - Dark
   ============================================================================= */
td.td_splashText {
	border: 1px solid var(--hb-primary);
	background: rgba(45, 114, 210, 0.1);
	padding: var(--hb-space-sm);
	color: var(--hb-gray-700);
	font-size: var(--hb-font-size-xs);
	line-height: 1.5;
	border-radius: var(--hb-radius-sm);
}

/* =============================================================================
   Groups Help - Dark
   ============================================================================= */
td.GroupsHelp {
	border: 1px solid var(--hb-primary);
	background: rgba(45, 114, 210, 0.1);
	padding: var(--hb-space-sm);
	color: var(--hb-gray-700);
	font-size: var(--hb-font-size-xs);
	border-radius: var(--hb-radius-sm);
}

/* =============================================================================
   Permissions Warning - Dark
   ============================================================================= */
td.PermissionsWarning {
	border: 1px solid var(--hb-danger);
	background: rgba(205, 66, 70, 0.1);
	padding: var(--hb-space-sm);
	color: var(--hb-danger-light);
	font-size: var(--hb-font-size-xs);
	border-radius: var(--hb-radius-sm);
}

/* =============================================================================
   Footer - Dark Compact
   ============================================================================= */
div.footer {
	position: fixed;
	left: 0;
	bottom: 0;
	width: 100%;
	background: var(--hb-dark-darker);
	color: var(--hb-gray-500);
	text-align: center;
	padding: 2px var(--hb-space-sm);
	font-size: 10px;
	z-index: 1000;
	border-top: 1px solid var(--hb-gray-200);
}

/* =============================================================================
   Responsive Adjustments - Compact
   ============================================================================= */
@media (max-width: 600px) {
	.hb-grid-sidebar {
		grid-template-columns: 1fr;
	}
	
	.hb-grid-licenses {
		grid-template-columns: 1fr;
	}
	
	.hb-grid-2 {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.hb-page-header {
		padding: var(--hb-space-sm);
	}
	
	.hb-card-body {
		padding: var(--hb-space-sm);
	}
	
	.hb-form-row {
		flex-direction: column;
		align-items: stretch;
	}
	
	.hb-label-inline {
		text-align: left;
		min-width: auto;
		margin-bottom: 2px;
	}
}

/* =============================================================================
   Sidebar Navigation (fMenu) - Federal Dark
   ============================================================================= */
.hb-sidebar {
	background: #111418;
	color: #F6F7F9;
	padding: var(--hb-space-sm) 0;
	height: 100vh;
	overflow-y: auto;
}

.hb-sidebar-header {
	padding: var(--hb-space-md) var(--hb-space-lg);
	border-bottom: 1px solid #2F343C;
	margin-bottom: var(--hb-space-sm);
}

.hb-sidebar-title {
	font-size: var(--hb-font-size-lg);
	font-weight: 600;
	color: #F6F7F9;
	margin: 0;
}

.hb-sidebar-subtitle {
	font-size: var(--hb-font-size-xs);
	color: #738091;
	margin-top: 2px;
}

.hb-nav-section {
	margin-bottom: var(--hb-space-xs);
}

.hb-nav-section-title {
	font-size: 11px;
	font-weight: 700;
	color: #738091;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	padding: var(--hb-space-sm) var(--hb-space-lg) var(--hb-space-xs);
	margin: 0;
}

.hb-nav-item {
	display: block;
	padding: var(--hb-space-sm) var(--hb-space-lg);
	color: #ABB3BF;
	text-decoration: none;
	font-size: var(--hb-font-size-sm);
	transition: all var(--hb-transition-fast);
	border-left: 3px solid transparent;
}

.hb-nav-item:hover {
	background: #1C2127;
	color: #F6F7F9;
	border-left-color: var(--hb-primary);
	text-decoration: none;
}

.hb-nav-item.active {
	background: #1C2127;
	color: #F6F7F9;
	border-left-color: var(--hb-primary);
	font-weight: 600;
}

.hb-nav-divider {
	height: 1px;
	background: #2F343C;
	margin: var(--hb-space-sm) var(--hb-space-lg);
}

.hb-nav-item-logout {
	color: #CD4246;
}

.hb-nav-item-logout:hover {
	background: rgba(205, 66, 70, 0.15);
	color: #E76A6E;
	border-left-color: #CD4246;
}

/* =============================================================================
   Permissions Grid (Groups Management) - Dark Compact
   ============================================================================= */
.hb-permissions-grid {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: var(--hb-space-xs);
	align-items: start;
}

.hb-permissions-grid-wide {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: var(--hb-space-sm);
	align-items: start;
}

.hb-permissions-grid-full {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: var(--hb-space-xs);
	align-items: start;
}

.hb-permissions-col {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hb-permissions-arrows {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-top: var(--hb-space-lg);
}

.hb-permissions-arrows-horizontal {
	display: flex;
	flex-direction: column;
	gap: 4px;
	justify-content: center;
	align-items: center;
	align-self: center;
}

.hb-select-list {
	width: 100%;
	min-height: 120px;
	padding: 2px;
	border: 1px solid var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-xs);
	background: #1C2127;
	color: var(--hb-gray-800);
}

.hb-select-list-wide {
	width: 100%;
	min-height: 150px;
	padding: 2px;
	border: 1px solid var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-xs);
	background: #1C2127;
	color: var(--hb-gray-800);
}

.hb-select-list-full {
	width: 100%;
	min-height: 120px;
	padding: 2px;
	border: 1px solid var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-xs);
	background: #1C2127;
	color: var(--hb-gray-800);
}

.hb-select-list:focus,
.hb-select-list-wide:focus,
.hb-select-list-full:focus {
	outline: none;
	border-color: var(--hb-primary);
	box-shadow: 0 0 0 2px rgba(45, 114, 210, 0.3);
}

.GroupsSearchResults {
	width: 100%;
	min-height: 120px;
	padding: 2px;
	border: 1px solid var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-xs);
	background: #1C2127;
	color: var(--hb-gray-800);
	cursor: pointer;
}

.GroupsSearchResults:focus {
	outline: none;
	border-color: var(--hb-primary);
	box-shadow: 0 0 0 2px rgba(45, 114, 210, 0.3);
}

/* Badge Styles */
.hb-badge {
	display: inline-block;
	padding: 1px 5px;
	border-radius: var(--hb-radius-full);
	font-size: var(--hb-font-size-xs);
	font-weight: 600;
}

.hb-badge-primary {
	background: var(--hb-primary);
	color: var(--hb-white);
}

.hb-ml-auto {
	margin-left: auto;
}

/* =============================================================================
   License Search Results
   ============================================================================= */
.LicensesSearchResults {
	width: 100%;
	min-height: 120px;
	padding: 2px;
	border: 1px solid var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-xs);
	background: #1C2127;
	color: var(--hb-gray-800);
	cursor: pointer;
}

.LicensesSearchResults:focus {
	outline: none;
	border-color: var(--hb-primary);
	box-shadow: 0 0 0 2px rgba(45, 114, 210, 0.3);
}

/* =============================================================================
   Statistics Grid
   ============================================================================= */
.hb-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: var(--hb-space-md);
}

.hb-stat-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: var(--hb-space-md);
	background: var(--hb-gray-50);
	border: 1px solid var(--hb-gray-200);
	border-radius: var(--hb-radius-sm);
	text-align: center;
}

.hb-stat-label {
	font-size: var(--hb-font-size-xs);
	color: var(--hb-gray-500);
	margin-bottom: var(--hb-space-xs);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.hb-stat-value {
	font-size: var(--hb-font-size-lg);
	font-weight: 600;
	color: var(--hb-primary);
	font-family: var(--hb-font-mono);
}

/* Compact Stats Grid (vertical layout) */
.hb-stats-grid-compact {
	display: flex;
	flex-direction: column;
	gap: var(--hb-space-xs);
}

.hb-stat-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: var(--hb-space-xs) var(--hb-space-sm);
	background: var(--hb-gray-50);
	border: 1px solid var(--hb-gray-200);
	border-radius: var(--hb-radius-sm);
}

.hb-stat-row .hb-stat-label {
	font-size: var(--hb-font-size-xs);
	color: var(--hb-gray-500);
	margin-bottom: 0;
}

.hb-stat-row .hb-stat-value {
	font-size: var(--hb-font-size-sm);
	font-weight: 600;
	color: var(--hb-primary);
	font-family: var(--hb-font-mono);
}

/* Two-column form grid */
.hb-form-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--hb-space-lg);
}

@media (max-width: 800px) {
	.hb-form-grid-2 {
		grid-template-columns: 1fr;
	}
}

.hb-form-col {
	display: flex;
	flex-direction: column;
	gap: var(--hb-space-xs);
}

.hb-form-col .hb-form-row {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hb-form-col .hb-label {
	font-size: var(--hb-font-size-xs);
	color: var(--hb-gray-500);
}

.hb-input-with-hint {
	display: flex;
	align-items: center;
	gap: var(--hb-space-xs);
}

/* Date input styling */
.hb-input-date {
	padding: 4px 8px;
	border: 1px solid var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	background: #1C2127;
	color: var(--hb-gray-800);
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-sm);
}

.hb-input-date:focus {
	outline: none;
	border-color: var(--hb-primary);
	box-shadow: 0 0 0 2px rgba(45, 114, 210, 0.3);
}

/* Templates Search Results */
.TemplatesSearchResults {
	width: 100%;
	min-height: 100px;
	padding: 2px;
	border: 1px solid var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	font-family: var(--hb-font-family);
	font-size: var(--hb-font-size-xs);
	background: #1C2127;
	color: var(--hb-gray-800);
	cursor: pointer;
}

.TemplatesSearchResults:focus {
	outline: none;
	border-color: var(--hb-primary);
	box-shadow: 0 0 0 2px rgba(45, 114, 210, 0.3);
}

/* Template Details Panel */
.hb-template-details {
	padding: var(--hb-space-sm);
	background: var(--hb-gray-50);
	border: 1px solid var(--hb-gray-200);
	border-radius: var(--hb-radius-sm);
}

.hb-detail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: var(--hb-space-xs);
}

.hb-detail-item {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.hb-detail-label {
	font-size: var(--hb-font-size-xs);
	color: var(--hb-gray-500);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.hb-detail-value {
	font-size: var(--hb-font-size-sm);
	color: var(--hb-gray-700);
	font-family: var(--hb-font-mono);
	word-break: break-all;
}

/* =============================================================================
   Avatar Management
   ============================================================================= */
.avatar-preview {
	width: 200px;
	height: 200px;
	border: 1px solid var(--hb-gray-300);
	object-fit: contain;
	background:
		linear-gradient(45deg, #383E47 25%, transparent 25%),
		linear-gradient(-45deg, #383E47 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #383E47 75%),
		linear-gradient(-45deg, transparent 75%, #383E47 75%);
	background-size: 16px 16px;
	background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
	background-color: #252A31;
}

.avatar-preview-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--hb-space-sm);
	padding: var(--hb-space-md);
	background: var(--hb-gray-50);
	border-radius: var(--hb-radius-md);
}

.avatar-name-preview {
	font-weight: 600;
	color: var(--hb-gray-700);
}

.avatar-list-item {
	display: flex;
	align-items: center;
	gap: var(--hb-space-sm);
}

.avatar-list-thumb {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid var(--hb-gray-300);
}

.personality-textarea {
	min-height: 90px;
	font-family: var(--hb-font-mono);
	font-size: var(--hb-font-size-xs);
}

.context-textarea {
	min-height: 100px;
	font-family: var(--hb-font-mono);
	font-size: var(--hb-font-size-xs);
}

/* Modal Overlay */
.hb-modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1000;
}

.hb-modal {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: var(--hb-card-bg);
	border-radius: var(--hb-radius-lg);
	padding: var(--hb-space-lg);
	min-width: 500px;
	max-width: 700px;
	box-shadow: var(--hb-shadow-xl);
}

.hb-modal h3 {
	margin: 0 0 var(--hb-space-md) 0;
}

/* File Upload */
.hb-file-input {
	flex: 1;
	padding: var(--hb-space-xs) var(--hb-space-sm);
	border: 1px solid var(--hb-gray-300);
	border-radius: var(--hb-radius-sm);
	background: #1C2127;
	color: var(--hb-gray-800);
	font-size: var(--hb-font-size-sm);
	cursor: pointer;
}

.hb-file-input:hover {
	border-color: var(--hb-primary);
}

.hb-file-input::file-selector-button {
	padding: var(--hb-space-xs) var(--hb-space-sm);
	margin-right: var(--hb-space-sm);
	border: none;
	border-radius: var(--hb-radius-sm);
	background: var(--hb-gray-100);
	color: var(--hb-gray-700);
	font-size: var(--hb-font-size-xs);
	cursor: pointer;
}

.hb-file-input::file-selector-button:hover {
	background: var(--hb-gray-200);
}

.hb-upload-preview {
	margin: var(--hb-space-sm) 0;
	padding: var(--hb-space-md);
	background: var(--hb-gray-50);
	border: 2px dashed var(--hb-success);
	border-radius: var(--hb-radius-md);
}

.avatar-preview-small {
	width: 60px;
	height: 60px;
	border: 1px solid var(--hb-gray-300);
	object-fit: contain;
	background:
		linear-gradient(45deg, #383E47 25%, transparent 25%),
		linear-gradient(-45deg, #383E47 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #383E47 75%),
		linear-gradient(-45deg, transparent 75%, #383E47 75%);
	background-size: 12px 12px;
	background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
	background-color: #252A31;
}

.avatar-browser-preview {
	width: 150px;
	height: 150px;
	border: 1px solid var(--hb-gray-300);
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		linear-gradient(45deg, #383E47 25%, transparent 25%),
		linear-gradient(-45deg, #383E47 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #383E47 75%),
		linear-gradient(-45deg, transparent 75%, #383E47 75%);
	background-size: 16px 16px;
	background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
	background-color: #252A31;
}

.avatar-browser-preview img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}


/* =============================================================================
   Login Page Styles
   ============================================================================= */

.login-page-body {
	font-family: 'Inter', 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background: linear-gradient(135deg, #111418 0%, #1C2127 50%, #162E51 100%);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.login-container {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.login-card {
	background: #252A31;
	border: 1px solid #404854;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	width: 100%;
	max-width: 440px;
	overflow: hidden;
}

.login-header {
	background: linear-gradient(135deg, #1A4480 0%, #162E51 100%);
	padding: 32px;
	text-align: center;
	border-bottom: 2px solid #2D72D2;
}

.login-header h1 {
	color: #F6F7F9;
	font-size: 26px;
	font-weight: 600;
	margin-bottom: 8px;
}

.login-header p {
	color: #ABB3BF;
	font-size: 15px;
}

.login-body {
	padding: 40px 32px 32px;
}

.login-form-group {
	margin-bottom: 24px;
}

.login-form-group label {
	display: block;
	color: #ABB3BF;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 8px;
}

.login-form-group input {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid #404854;
	border-radius: 4px;
	font-size: 16px;
	background: #1C2127;
	color: #F6F7F9;
	transition: border-color 0.2s, box-shadow 0.2s;
	outline: none;
	box-sizing: border-box;
}

.login-form-group input:focus {
	border-color: #2D72D2;
	box-shadow: 0 0 0 3px rgba(45, 114, 210, 0.25);
}

.btn-login {
	width: 100%;
	padding: 14px;
	background: #2D72D2;
	border: none;
	border-radius: 4px;
	color: #F6F7F9;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-login:hover {
	background: #4C90F0;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(45, 114, 210, 0.4);
}

.btn-login:active {
	transform: translateY(0);
}

.login-error-message {
	background: rgba(205, 66, 70, 0.15);
	border: 1px solid #CD4246;
	border-radius: 4px;
	padding: 12px 16px;
	margin-bottom: 24px;
	color: #E76A6E;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.login-error-message::before {
	content: "!";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	background: #CD4246;
	color: #F6F7F9;
	border-radius: 50%;
	font-size: 12px;
	font-weight: bold;
	flex-shrink: 0;
}

.security-notice {
	background: #1C2127;
	border-top: 1px solid #404854;
	padding: 20px 32px;
}

.security-notice p {
	color: #738091;
	font-size: 13px;
	line-height: 1.6;
	text-align: center;
	margin: 0;
}

.status-bar {
	background: #111418;
	border-top: 1px solid #2F343C;
	padding: 12px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.status-bar span {
	color: #738091;
	font-size: 13px;
	font-family: 'Roboto Mono', 'Consolas', monospace;
}

.status-bar .label {
	color: #5F6B7C;
	margin-right: 6px;
}
