/* ----------------------------------------------------------------
//
//	FCompass.css
//	Fiduciary Compass -- Application Design System
//	Version 0.2.0.a
//
//	Intended use:
//	Shared stylesheet for all Fiduciary Compass application pages.
//	Extracted from the approved reference design at
//	https://hagimo.com/FiduciaryCompass_UI_Demo.html so the built
//	platform matches the reference exactly. Selectors and values
//	mirror the reference; only demo-wrapper styles were omitted
//	and login/nav-disabled styles added.
//
//	Hagimo LLC -- sean.harrison@hagimo.com -- hagimo.com
//
---------------------------------------------------------------- */

:root {
	--primary: #1e3a5f;
	--primary-light: #2d5a8a;
	--accent: #c9a227;
	--accent-light: #e8c84a;
	--success: #2e7d4a;
	--warning: #d4a017;
	--danger: #c44536;
	--gray-50: #f8f9fa;
	--gray-100: #e9ecef;
	--gray-200: #dee2e6;
	--gray-300: #ced4da;
	--gray-400: #adb5bd;
	--gray-500: #6c757d;
	--gray-600: #495057;
	--gray-700: #343a40;
	--gray-800: #212529;
	--white: #ffffff;
	--shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
	--shadow-md: 0 4px 12px rgba(0,0,0,0.1);
	--shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
	font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: var(--gray-700);
	background: #f0f2f5;
}

/* === APPLICATION SHELL === */
/* Centered, capped at 1280px on wide displays; fills the viewport and
   scales down gracefully below that. */
.app-container {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	box-shadow: 0 0 30px rgba(0,0,0,0.12);
}

.app-header {
	background: var(--primary);
	color: var(--white);
	padding: 0 20px;
	height: 56px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.app-header-left {
	display: flex;
	align-items: center;
	gap: 32px;
}

.app-logo {
	font-weight: 700;
	font-size: 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--white);
}

.app-logo svg { width: 28px; height: 28px; }

.app-nav {
	display: flex;
	gap: 4px;
}

.app-nav a {
	color: rgba(255,255,255,0.7);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	padding: 8px 14px;
	border-radius: 4px;
	transition: all 0.2s;
}

.app-nav a:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.app-nav a.active { background: rgba(255,255,255,0.15); color: var(--white); }
.app-nav a.disabled { color: rgba(255,255,255,0.35); cursor: default; }
.app-nav a.disabled:hover { background: none; color: rgba(255,255,255,0.35); }

.app-header-right {
	display: flex;
	align-items: center;
	gap: 20px;
	font-size: 14px;
}

.notification-btn {
	position: relative;
	background: none;
	border: none;
	color: var(--white);
	cursor: pointer;
	padding: 4px;
}

.notification-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: var(--accent);
	color: var(--primary);
	font-size: 10px;
	font-weight: 700;
	padding: 2px 5px;
	border-radius: 10px;
	min-width: 16px;
	text-align: center;
}

.user-menu, .org-menu {
	background: none;
	border: none;
	color: var(--white);
	font-size: 14px;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 4px;
	text-decoration: none;
}

.user-menu:hover, .org-menu:hover { background: rgba(255,255,255,0.1); }

.app-body {
	flex: 1;
	padding: 24px;
	background: var(--gray-100);
}

.page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
}

.page-title {
	font-size: 22px;
	font-weight: 600;
	color: var(--gray-800);
}

.page-title small {
	font-size: 14px;
	font-weight: 400;
	color: var(--gray-500);
	margin-left: 12px;
}

.page-actions { display: flex; gap: 8px; }

/* === BUTTONS === */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	border-radius: 6px;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s;
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: var(--primary); }
.btn-outline { background: var(--white); color: var(--gray-600); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }

/* === PANELS === */
.panel {
	background: var(--white);
	border: 1px solid var(--gray-200);
	border-radius: 8px;
	box-shadow: var(--shadow-sm);
}

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

.panel-header h5 {
	font-size: 15px;
	font-weight: 600;
	color: var(--gray-700);
	margin: 0;
}

.panel-header a {
	font-size: 13px;
	color: var(--primary-light);
	text-decoration: none;
}

.panel-body { padding: 20px; }

/* === SCORE CARD === */
.score-card {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	color: var(--white);
	border-radius: 8px;
	padding: 24px;
	text-align: center;
}

.score-card h5 {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	opacity: 0.8;
	margin-bottom: 16px;
}

.score-gauge {
	position: relative;
	width: 140px;
	height: 140px;
	margin: 0 auto 16px;
}

.score-gauge svg { transform: rotate(-90deg); }
.score-gauge .bg { fill: none; stroke: rgba(255,255,255,0.2); stroke-width: 12; }
.score-gauge .progress { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 377; }

.score-value {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 36px;
	font-weight: 700;
}

.score-value span { font-size: 18px; opacity: 0.8; }
.score-change { font-size: 14px; color: var(--accent-light); }
.score-change.positive::before { content: '+ '; }

.tasks-summary { margin-top: 24px; text-align: left; }
.tasks-summary h5 { text-align: left; margin-bottom: 12px; }

.task-stat {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255,255,255,0.1);
}

.task-stat:last-child { border-bottom: none; }

.dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	display: inline-block;
	margin-right: 8px;
}

.dot-complete { background: var(--success); }
.dot-pending { background: var(--gray-400); }
.dot-overdue { background: var(--danger); }
.dot-deferred { background: var(--warning); }

/* === TASK LIST (dashboard panel) === */
.task-list { list-style: none; padding: 0; margin: 0; }

.task-item {
	display: flex;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--gray-100);
	gap: 12px;
}

.task-item:last-child { border-bottom: none; }

.task-status {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.status-due { background: var(--danger); }
.status-upcoming { background: var(--warning); }
.status-pending { background: var(--gray-400); }

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

.task-title {
	font-size: 14px;
	font-weight: 500;
	color: var(--gray-700);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.task-meta { font-size: 12px; color: var(--gray-500); }
.task-date { font-size: 13px; color: var(--gray-500); white-space: nowrap; }
.task-date.overdue { color: var(--danger); font-weight: 600; }

/* === STATUS BADGES === */
.status-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.status-badge.overdue { background: #fde8e8; color: var(--danger); }
.status-badge.pending { background: var(--gray-100); color: var(--gray-600); }
.status-badge.complete { background: #def7ec; color: var(--success); }
.status-badge.deferred { background: #fef3cd; color: #856404; }
.status-badge.active { background: #def7ec; color: var(--success); }
.status-badge.inactive { background: var(--gray-100); color: var(--gray-500); }

/* === DATA TABLES === */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table th {
	text-align: left;
	padding: 12px 16px;
	background: var(--gray-50);
	font-weight: 600;
	color: var(--gray-600);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 2px solid var(--gray-200);
}

.data-table td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--gray-100);
	vertical-align: middle;
}

.data-table tr:hover { background: var(--gray-50); }

/* === FORMS === */
.form-group { margin-bottom: 20px; }

.form-label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: var(--gray-700);
	margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	border: 1px solid var(--gray-300);
	border-radius: 6px;
	font-family: inherit;
}

.form-select {
	background: var(--white) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") right 10px center/16px no-repeat;
	appearance: none;
	padding-right: 36px;
	cursor: pointer;
}

.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* === TOOLBAR / FILTERS === */
.toolbar {
	display: flex;
	gap: 12px;
	margin-bottom: 20px;
	flex-wrap: wrap;
	align-items: center;
}

.filter-group {
	display: flex;
	align-items: center;
	gap: 8px;
}

.filter-group label {
	font-size: 13px;
	color: var(--gray-500);
	white-space: nowrap;
}

.filter-select {
	padding: 8px 32px 8px 12px;
	font-size: 14px;
	border: 1px solid var(--gray-300);
	border-radius: 6px;
	background: var(--white) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") right 8px center/16px no-repeat;
	appearance: none;
	cursor: pointer;
}

.search-box {
	flex: 1;
	min-width: 200px;
	position: relative;
}

.search-box input {
	width: 100%;
	padding: 8px 12px 8px 36px;
	font-size: 14px;
	border: 1px solid var(--gray-300);
	border-radius: 6px;
}

.search-box .search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--gray-400);
}

/* === WIZARD === */
.wizard-steps {
	display: flex;
	margin-bottom: 40px;
	position: relative;
}

.wizard-steps::before {
	content: '';
	position: absolute;
	top: 16px;
	left: 60px;
	right: 60px;
	height: 2px;
	background: var(--gray-200);
}

.wizard-step {
	flex: 1;
	text-align: center;
	position: relative;
}

.wizard-step .step-number {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--gray-200);
	color: var(--gray-500);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 8px;
	position: relative;
	z-index: 1;
}

.wizard-step.active .step-number { background: var(--primary); color: var(--white); }
.wizard-step.complete .step-number { background: var(--success); color: var(--white); }
.wizard-step .step-label { font-size: 13px; color: var(--gray-500); }
.wizard-step.active .step-label { color: var(--primary); font-weight: 600; }

.wizard-footer {
	display: flex;
	justify-content: space-between;
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--gray-200);
}

/* === TEMPLATE SELECTION === */
.template-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.template-option {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	border: 2px solid var(--gray-200);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
}

.template-option:hover { border-color: var(--gray-300); background: var(--gray-50); }
.template-option.selected { border-color: var(--primary); background: rgba(30, 58, 95, 0.03); }

.template-radio {
	width: 20px;
	height: 20px;
	border: 2px solid var(--gray-300);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.template-option.selected .template-radio { border-color: var(--primary); }

.template-option.selected .template-radio::after {
	content: '';
	width: 10px;
	height: 10px;
	background: var(--primary);
	border-radius: 50%;
}

.template-info { flex: 1; }
.template-name { font-weight: 600; color: var(--gray-700); margin-bottom: 2px; }
.template-desc { font-size: 13px; color: var(--gray-500); }

.template-badge {
	font-size: 11px;
	padding: 4px 10px;
	border-radius: 4px;
	background: var(--gray-100);
	color: var(--gray-600);
}

.template-badge.custom { background: rgba(201, 162, 39, 0.15); color: #8b6914; }

/* === CALENDAR === */
.calendar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.calendar-nav {
	display: flex;
	align-items: center;
	gap: 16px;
}

.calendar-title { font-size: 18px; font-weight: 600; }

.calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 1px;
	background: var(--gray-200);
	border: 1px solid var(--gray-200);
	border-radius: 8px;
	overflow: hidden;
}

.calendar-day-header {
	background: var(--gray-50);
	padding: 12px;
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	color: var(--gray-500);
	text-transform: uppercase;
}

.calendar-day {
	background: var(--white);
	min-height: 80px;
	padding: 8px;
}

.calendar-day.other-month { background: var(--gray-50); }

.calendar-day .day-number {
	font-size: 13px;
	font-weight: 500;
	color: var(--gray-600);
	margin-bottom: 6px;
}

.calendar-day.other-month .day-number { color: var(--gray-400); }

.calendar-day.today .day-number {
	background: var(--primary);
	color: var(--white);
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.calendar-event {
	font-size: 11px;
	padding: 3px 6px;
	border-radius: 3px;
	margin-bottom: 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.calendar-event.due { background: #fde8e8; color: var(--danger); }
.calendar-event.upcoming { background: #fef3cd; color: #856404; }
.calendar-event.meeting { background: #dbeafe; color: #1e40af; }
.calendar-event.complete { background: #def7ec; color: var(--success); }
.calendar-event.clickable { cursor: pointer; }

/* Calendar popup window chrome */
.calendar-popup-body { background: var(--gray-100); }
.calendar-popup-bar {
	background: var(--primary);
	color: var(--white);
	padding: 10px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-weight: 600;
}
.calendar-popup-bar .btn { padding: 4px 10px; font-size: 13px; }
.calendar-popup-main { padding: 16px; }

/* === CHARTS === */
.chart-container { position: relative; height: 150px; }
.chart-svg { width: 100%; height: 100%; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#chartGradient); }
.chart-grid line { stroke: var(--gray-200); stroke-width: 1; }

.chart-labels {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--gray-500);
	margin-top: 8px;
	padding: 0 10px;
}

/* === GRIDS === */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dashboard-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }

/* === PAGINATION === */
.pagination {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 20px;
	padding: 16px 20px;
	font-size: 14px;
	color: var(--gray-500);
	border-top: 1px solid var(--gray-200);
}

.pagination-buttons { display: flex; gap: 8px; }

/* === ALERTS === */
.alert {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 20px;
	font-size: 14px;
}

.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning { background: #fef3cd; color: #856404; border: 1px solid #f2dd9c; }

/* === DOCUMENT VAULT === */
.folder-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}

.folder-card {
	background: var(--white);
	border: 1px solid var(--gray-200);
	border-radius: 8px;
	padding: 20px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s;
}

.folder-card:hover {
	border-color: var(--primary);
	box-shadow: var(--shadow-md);
}

.folder-icon { font-size: 40px; margin-bottom: 12px; }
.folder-name { font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.folder-count { font-size: 12px; color: var(--gray-500); }

.file-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--gray-100);
}

.file-row:hover { background: var(--gray-50); }
.file-icon { font-size: 24px; width: 40px; text-align: center; }
.file-info { flex: 1; }
.file-name { font-weight: 500; color: var(--gray-700); margin-bottom: 2px; }
.file-meta { font-size: 12px; color: var(--gray-500); }
.file-actions { display: flex; gap: 8px; }

.breadcrumb {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	margin-bottom: 20px;
}

.breadcrumb a { color: var(--primary-light); text-decoration: none; }
.breadcrumb span { color: var(--gray-400); }

/* === USER MANAGER === */
.user-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--primary-light);
	color: var(--white);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 14px;
}

.permission-group { margin-bottom: 24px; }

.permission-group h4 {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--gray-500);
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--gray-200);
}

.permission-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--gray-100);
}

.permission-item:last-child { border-bottom: none; }
.permission-label { font-size: 14px; color: var(--gray-700); }
.permission-desc { font-size: 12px; color: var(--gray-500); }

.toggle-switch {
	position: relative;
	width: 44px;
	height: 24px;
	background: var(--gray-300);
	border-radius: 12px;
	cursor: pointer;
	transition: background 0.2s;
}

.toggle-switch.active { background: var(--success); }

.toggle-switch::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	background: var(--white);
	border-radius: 50%;
	transition: transform 0.2s;
}

.toggle-switch.active::after { transform: translateX(20px); }

/* === UTILITIES === */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 13px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* === TABS === */
.tab-bar {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid var(--gray-200);
	margin-bottom: 24px;
}

.tab-btn {
	border-radius: 6px 6px 0 0;
	border-bottom: none;
	background: var(--gray-100);
	color: var(--gray-600);
}

.tab-btn.active {
	background: var(--white);
	color: var(--primary);
	border-color: var(--gray-200);
	border-bottom-color: var(--white);
	margin-bottom: -2px;
	padding-bottom: 10px;
}

/* === LOGIN / SELECTION (application pages not shown in the demo,
       styled with the same design system) === */
.login-shell {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--primary) 0%, #2d4a6f 100%);
	padding: 24px;
}

.login-panel {
	background: var(--white);
	border-radius: 8px;
	box-shadow: var(--shadow-lg);
	width: 100%;
	max-width: 420px;
	overflow: hidden;
}

.login-panel-header {
	background: var(--primary);
	color: var(--white);
	padding: 28px 32px;
	text-align: center;
}

.login-panel-header h1 {
	font-size: 22px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.login-panel-header p {
	font-size: 13px;
	opacity: 0.75;
	margin-top: 4px;
}

.login-panel-body { padding: 32px; }

.login-error {
	background: #fde8e8;
	color: var(--danger);
	border: 1px solid #f5c2c0;
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 14px;
	margin-bottom: 20px;
}

.login-footnote {
	background: var(--gray-50);
	border-top: 1px solid var(--gray-200);
	color: var(--gray-500);
	font-size: 11px;
	padding: 14px 32px;
	line-height: 1.5;
}

.selection-shell {
	max-width: 640px;
	margin: 0 auto;
	padding: 40px 24px;
}
