/* Component: Dashboard layout, tabs, cards and tables. Rules are plugin-scoped (.cbah-*). */
/* =================================================_
   Scoped Typography Styles
   ================================================= */

/* Never style the host theme globally. Dashboard typography is scoped to the plugin app. */
.cbah-app-wrapper {
    font-family: var(--cbah-body-font, "Josefin Sans", sans-serif);
}

.cbah-app-wrapper p,
.cbah-app-wrapper li,
.cbah-app-wrapper td,
.cbah-app-wrapper th,
.cbah-app-wrapper label {
    font-size: 0.9rem;
    line-height: 1.2em;
}

.cbah-app-wrapper h1,
.cbah-app-wrapper h2,
.cbah-app-wrapper h3,
.cbah-app-wrapper h4,
.cbah-app-wrapper h5,
.cbah-app-wrapper h6,
.cbah-reports-preview h2 {
    font-family: var(--cbah-heading-font, "Josefin Sans", sans-serif);
    font-size: 1rem;
}

.cbah-card-header {
    font-family: var(--cbah-heading-font, "Josefin Sans", sans-serif);
    font-size: 0.7rem !important;
}


.cbah-fixed-income-label {
    font-family: var(--cbah-heading-font, "Josefin Sans", sans-serif);
    font-size: 0.7rem;
}
/* Core App Wrapper */
.cbah-app-wrapper {
	display: flex;
	font-family: var(--cbah-body-font, "Josefin Sans", sans-serif);
	background-color: #f4f6f9;
	min-height: 85vh;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* SIDEBAR STYLES (Deep Navy Premium) */
.cbah-sidebar {
	width: 240px;
	background-color: #0f172a;
	color: #94a3b8;
	flex-shrink: 0;
	padding-top: 24px;
}
.cbah-nav-item {
	padding: 14px 22px; /* Reduced padding to fit 7 items */
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	border-left: 4px solid transparent;
	letter-spacing: 0.3px;
}
.cbah-nav-item .dashicons {
	margin-right: 14px;
	font-size: 16px; /* Slightly reduced icon size */
	color: #64748b;
	transition: 0.2s;
}
.cbah-nav-item:hover {
	background-color: #1e293b;
	color: #f8fafc;
}
.cbah-nav-item.active {
	background-color: #1e293b;
	color: #ffffff;
	border-left-color: #3b82f6;
	font-weight: 600;
}
.cbah-nav-item.active .dashicons {
	color: #3b82f6;
}

/* MAIN CONTENT AREA */
.cbah-main-content {
	flex-grow: 1;
	padding: 26px;
	box-sizing: border-box;
	background: #f8fafc;
}
.cbah-tab-pane {
	display: none;
	animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cbah-tab-pane.active {
	display: block;
}
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Grid System */
.cbah-grid-3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin-bottom: 24px;
}

/* Thin Elegant Custom Scrollbar */
.cbah-scroll-y {
	overflow-y: auto;
}
.cbah-scroll-y::-webkit-scrollbar {
	width: 6px;
}
.cbah-scroll-y::-webkit-scrollbar-track {
	background: #f1f5f9;
}
.cbah-scroll-y::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 6px;
}
.cbah-scroll-y::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* Master-Detail Split Layouts (Reports & Market Data) */
.cbah-reports-layout {
	display: flex;
	gap: 24px;
	align-items: stretch;
}
.cbah-reports-list {
	flex: 1.6;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	overflow: hidden;
}
.cbah-reports-preview {
	flex: 1;
	background: #f1f5f9;
	padding: 32px;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}
.cbah-reports-preview h2 {
	margin-top: 0;
	color: #0f172a;
	font-size: 18px;
	font-weight: 700;
	border-bottom: 1px solid #cbd5e1;
	padding-bottom: 16px;
	margin-bottom: 20px;
	line-height: 1.4;
}
.cbah-preview-text {
	color: #475569;
	line-height: 1.7;
	font-size: 13px;
	margin-bottom: 30px;
	flex-grow: 1;
}

/* Report directory date column: keep heading and populated dates on the same right edge. */
.cbah-reports-list .cbah-data-table thead th:nth-child(2),
.cbah-reports-list .cbah-data-table tbody td:nth-child(2) {
    text-align: right !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

.cbah-reports-list .cbah-data-table tbody td:nth-child(2) a,
.cbah-reports-list .cbah-data-table tbody td:nth-child(2) span {
    white-space: nowrap !important;
}

/* Keep report action buttons visually consistent without changing their labels. */
.cbah-reports-list .cbah-report-actions .cbah-download-report,
.cbah-reports-preview .cbah-download-report {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
}

/* Cards */
.cbah-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: box-shadow 0.2s;
}
.cbah-card:hover {
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.cbah-card-header {
	background-color: #1e293b;
	color: #f8fafc;
	padding: 14px 16px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}
.cbah-card-body {
	padding: 16px;
	flex-grow: 1;
}
.cbah-card-body.cbah-no-pad {
	padding: 0;
}

/* Chart Filters */
.cbah-chart-filters {
	text-align: center;
	margin-bottom: 16px;
	font-size: 12px;
	color: #64748b;
}
.cbah-chart-filters span {
	display: inline-block;
	padding: 4px 12px;
	margin: 0 4px;
	border-radius: 16px;
	cursor: pointer;
	transition: 0.2s;
	font-weight: 500;
}
.cbah-chart-filters span:hover {
	background-color: #f1f5f9;
	color: #0f172a;
}
.cbah-chart-filters span.active {
	background-color: #e2e8f0;
	color: #0f172a;
	font-weight: 700;
}

/* Form Elements */
.cbah-dropdown-minimal {
	border: 1px solid #cbd5e1;
	background: #fff;
	padding: 4px 8px;
	font-size: 11px;
	border-radius: 4px;
	color: #0f172a;
	cursor: pointer;
	outline: none;
	font-weight: 500;
}
.cbah-search-wrapper {
	display: flex;
	align-items: center;
	background: #fff;
	border-radius: 4px;
	padding: 2px 10px;
}
.cbah-search-input {
	border: none;
	outline: none;
	padding: 6px;
	font-size: 13px;
	width: 180px;
	color: #0f172a;
}

/* Data Tables */
.cbah-data-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	padding: 0;
}

.cbah-data-table th:nth-child(1),
.cbah-data-table td:nth-child(1) {
	padding-left: 20px;
} 

.cbah-data-table th:nth-child(3),
.cbah-data-table td:nth-child(3) {
	text-align: right;
} 

.cbah-data-table th:last-child,
.cbah-data-table td:last-child {
	text-align: right;
	padding-right: 20px;
}

.cbah-data-table th,
.cbah-data-table td {
	padding: 11px;
	text-align: left;
	font-size: 0.8rem;
	border-bottom: 1px solid #f1f5f9;
	color: #334155;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cbah-data-table th {
	color: #64748b;
	font-weight: 600;
	font-size: 0.7rem;
	background: #f8fafc;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	position: sticky;
	top: 0;
	z-index: 10;
	white-space: nowrap;
}
.cbah-data-table td strong {
	color: #0f172a;
	font-weight: 600;
}
.cbah-empty {
	text-align: center !important;
	color: #94a3b8;
	font-style: italic;
	padding: 40px 0 !important;
}

/* Interactive Table Rows */
.cbah-table-hover tbody tr {
	transition: background-color 0.15s ease;
}
.cbah-table-hover tbody tr:hover {
	background-color: #f1f5f9 !important;
}
.cbah-table-hover tbody tr:hover td,
.cbah-table-hover tbody tr:hover td strong {
	color: #0f172a !important;
	background-color: transparent !important;
}
.cbah-interactive-table tbody tr {
	cursor: pointer;
	transition: background 0.15s;
}
.cbah-interactive-table tbody tr:hover {
	background-color: #f1f5f9;
}
.cbah-interactive-table tbody tr.active-row {
	background-color: #e2e8f0;
	border-left: 3px solid #3b82f6;
}

/* Micro-elements */
.cbah-txt-green {
	color: #10b981;
	font-weight: 600;
}
.cbah-txt-red {
	color: #ef4444;
	font-weight: 600;
}
.cbah-btn-view {
	display: inline-block;
	background: #f1f5f9;
	color: #0f172a !important;
	border: 1px solid #cbd5e1;
	text-decoration: none;
	padding: 4px 14px;
	border-radius: 0;
	font-size: 12px;
	font-weight: 600;
	transition: 0.2s;
}
.cbah-btn-view:hover {
	background: #e2e8f0;
	border-color: #94a3b8;
}
.cbah-btn-large {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #1e293b;
	color: #fff !important;
	text-decoration: none;
	padding: 12px 24px;
	border-radius: 0;
	font-weight: 600;
	transition: 0.2s;
	font-size: 13px;
}
.cbah-btn-large:hover {
	background: #0f172a;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
	transform: translateY(-1px);
}

/* All plugin download actions use the same visual treatment as the Equity Reports download button. */
.cbah-btn-download {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #1e293b !important;
	color: #fff !important;
	text-decoration: none !important;
	padding: 10px 18px !important;
	border: 0 !important;
	border-radius: 0 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	white-space: nowrap !important;
	word-break: keep-all !important;
	overflow-wrap: normal !important;
	transition: 0.2s;
}
.cbah-btn-download:hover {
	background: #0f172a !important;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
	transform: translateY(-1px);
}


/* Sub-headers for Split Cards */
.cbah-sub-header {
    background-color: #f1f5f9;
    color: #475569;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

/* Quick Select Ticker Pills */
.cbah-pill-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cbah-pill-btn:hover {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
}


/* Mobile */
@media (max-width: 1100px) {
	.cbah-grid-3 {
		grid-template-columns: 1fr 1fr;
	}
	.cbah-reports-layout {
		flex-direction: column;
	}
}
@media (max-width: 768px) {
	.cbah-app-wrapper {
		flex-direction: column;
	}
	.cbah-sidebar {
		width: 100%;
		display: flex;
		overflow-x: auto;
		padding-top: 0;
	}
	.cbah-nav-item {
		border-left: none;
		border-bottom: 3px solid transparent;
		padding: 12px 14px;
	}
	.cbah-nav-item.active {
		border-left-color: transparent;
		border-bottom-color: #3b82f6;
	}
	.cbah-grid-3 {
		grid-template-columns: 1fr;
	}
}

