/**
 * kt-theme.css — shared design tokens + common component classes for
 * KT Portfolio Core (FFA + Stocks/Bonds).
 * ---------------------------------------------------------------------------
 * ROUND 1 of the CSS unification pass. Every value below was extracted
 * directly from the plugin's existing inline styles (not invented) - grepped
 * across all PHP files for repeated hex colors and repeated style-string
 * patterns, so wiring a page to use these classes/variables produces the
 * exact same pixels as before, just centralized in one place.
 *
 * Naming: uses the --aerm- prefix to match the one CSS variable already in
 * use in the codebase (class-blotter-stock.php references
 * var(--aerm-text,#E6E9ED) defensively, suggesting the site's theme may
 * already use this convention) - --aerm-text below is defined with that
 * exact same value, so that existing reference now resolves properly
 * instead of relying on its fallback.
 *
 * This file changes NOTHING visually by itself - nothing references these
 * classes/variables yet. Each subsequent round converts one batch of PHP
 * files to use them (inline styles -> class="..."), reviewed one file at a
 * time before moving to the next.
 *
 * To re-theme the whole app later (e.g. change the accent color everywhere):
 * edit the :root block below - every page wired to these variables updates
 * at once, no PHP file edits needed.
 * ---------------------------------------------------------------------------
 */

:root {
	/* Backgrounds */
	--aerm-panel-bg:      #1E242C; /* main dark panel/table background */
	--aerm-panel-bg-alt:  #2F3743; /* lighter panel variant - edit forms, select boxes */
	--aerm-bg-deep:       #0F1318; /* deepest background - buttons, inputs, sticky columns */

	/* Text */
	--aerm-text:          #E6E9ED; /* primary text on dark backgrounds */
	--aerm-text-soft:     #CFD8E3; /* secondary text on --aerm-bg-deep controls */
	--aerm-text-muted:    #9FB3C8; /* table header labels, secondary captions */
	--aerm-text-faint:    #5B6470; /* disabled/placeholder text */

	/* Status colors */
	--aerm-positive:        #6EE07A; /* gains / long / good */
	--aerm-positive-bright: #8FF0B0; /* save/confirm accents */
	--aerm-negative:        #FF6B6B; /* losses / short / bad */
	--aerm-danger:          #B00020; /* delete / hard error */
	--aerm-danger-bg:       #FDE3F3; /* error badge background (paired with --aerm-danger text) */
	--aerm-warning:         #FFB74D; /* warnings / amber highlights */
	--aerm-warning-soft:    #FFD79A; /* softer warning text on warning-bordered boxes */

	/* Accents */
	--aerm-accent:        #4FC3F7; /* active state, links, primary buttons */
	--aerm-accent-light:  #8FD6FF; /* lighter accent variant */
	--aerm-accent-purple: #C792EA; /* tertiary accent (icon buttons) */

	/* Borders (derived from --aerm-text at reduced opacity - matches the
	   rgba(230,233,237,.NN) pattern used throughout) */
	--aerm-border-strong: rgba(230, 233, 237, 0.28);
	--aerm-border-soft:   rgba(230, 233, 237, 0.12);

	/* Index identity colors (front-end dark theme only - the WP-admin light-
	   theme screens use a separate, darker set of index colors that is NOT
	   centralized here, e.g. class-kt-ffa-settlement.php's idx_colour(), by
	   design: same intent, different context, shouldn't move together).
	   Confirmed byte-identical duplicated as a literal 4-entry array in 4
	   files: kt-portfolio-core.php, class-kt-ffa-settlement.php (render_readonly),
	   class-kt-ffa-blotter.php, class-kt-ffa-risk-matrices.php. Kept as their
	   own named tokens (not aliased to --aerm-accent/--aerm-positive/etc, even
	   though 3 of the 4 currently share a value) so re-branding one index's
	   color later can't accidentally also change an unrelated generic accent. */
	--aerm-idx-c5tc:  #FF5252;
	--aerm-idx-p5tc:  #4FC3F7;
	--aerm-idx-s10tc: #6EE07A;
	--aerm-idx-h7tc:  #C792EA;

	/* Shared metrics */
	--aerm-radius: 8px;
	--aerm-font:   Arial, Helvetica, sans-serif;
}

/* ---------------------------------------------------------------------------
 * Panel + table pattern - confirmed duplicated verbatim 6 times across
 * kt-portfolio-core.php, class-kt-ffa-settlement.php, class-kt-ffa-index.php,
 * class-kt-ffa-risk-matrices.php, class-kt-ffa-var.php (x2) (the
 * $box/$thL/$thR/$tdL/$tdR PHP variables). Values transcribed exactly.
 * ------------------------------------------------------------------------ */

.kt-panel {
	background: var(--aerm-panel-bg);
	color: var(--aerm-text);
	padding: 12px;
	border-radius: var(--aerm-radius);
	overflow-x: auto;
	font-family: var(--aerm-font);
}

.kt-th-l {
	text-align: left;
	padding: 7px 10px;
	color: var(--aerm-text-muted);
	border-bottom: 2px solid var(--aerm-border-strong);
	white-space: nowrap;
}

.kt-th-r {
	text-align: right;
	padding: 7px 10px;
	color: var(--aerm-text-muted);
	border-bottom: 2px solid var(--aerm-border-strong);
	white-space: nowrap;
}

.kt-td-l {
	text-align: left;
	padding: 6px 10px;
	border-bottom: 1px solid var(--aerm-border-soft);
	white-space: nowrap;
}

.kt-td-r {
	text-align: right;
	padding: 6px 10px;
	border-bottom: 1px solid var(--aerm-border-soft);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
