:root {
    --bg: #080A0E;
    --surface: #0E1218;
    --surface-2: #141820;
    --border: #1E2530;
    --border-2: #252D3A;

    --text: #E8EDF5;
    --text-2: #D6DCE2;
    --text-3: #AEB8C2;

    --gold: #C9A84C;
    --gold-2: #E8C97A;
    --blue: #3B82F6;
    --green: #2ECC71;
    --red: #E74C3C;

    --font-body: "DM Sans", sans-serif;
    --font-mono: "DM Mono", monospace;
    --font-display: "Bebas Neue", sans-serif;
}

* {
    box-sizing: border-box;
}

/* App-wide scrollbar styling (vertical and horizontal) — replaces the default OS scrollbar with one
   that matches the dark tactical theme, on every scrollable element, not just the page body. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) var(--surface);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--surface);
}

*::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border: 2px solid var(--surface);
    border-radius: 0;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

*::-webkit-scrollbar-corner {
    background: var(--surface);
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--gold);
    text-decoration: none;
}

a:hover {
    color: var(--gold-2);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text);
    margin: 0 0 16px 0;
}

h1 {
    font-size: 2.5rem;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--gold);
    margin-bottom: 16px;
}

.mono {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Single canonical "field label" recipe for the whole app — every uppercase/tracked caption above
   a form input, a detail-view field, a table column header, a dashboard stat tile, or a calculator
   result value shares this ONE definition. To change label styling anywhere, change it here — do
   not redeclare this recipe in a page-specific CSS file again (that duplication is exactly what let
   two orphaned <label> elements in Mt5Import.razor go unstyled, and made repeated contrast fixes
   miss elements). Add new label-like selectors to this list instead. Uses the brightest `--text`
   tone, not a muted tier — labels are differentiated from values by case/tracking/font, not by
   being dimmer, since dimming them was the recurring source of "still too dark" reports.  */
label,
.details-grid dt,
.users-table thead th,
.dashboard-stat-label,
.result-label {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text);
    margin-bottom: 6px;
}

label,
.dashboard-stat-label {
    display: block;
}

.card,
.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 0;
}

.panel-section {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    padding: 24px;
}

.panel-section + .panel-section {
    margin-top: 24px;
}

.panel-section .section-label {
    margin-bottom: 20px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
    background: var(--surface);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    border-radius: 0;
    width: 100%;
    outline: none;
    transition: border-color 120ms ease;
    color-scheme: dark;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-3);
}

input[type="file"] {
    color: var(--text-2);
    font-family: var(--font-body);
    font-size: 13px;
    width: auto;
}

input[type="file"]::file-selector-button {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 10px 18px;
    margin-right: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 0;
    cursor: pointer;
    transition: border-color 120ms ease, color 120ms ease;
}

input[type="file"]::file-selector-button:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Chrome/Safari autofill — the yellow/blue background overrides our surface;
   the inset shadow trick paints over it with our dark surface. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text);
    transition: background-color 5000s ease-in-out 0s;
    border: 1px solid var(--border-2) !important;
}

/* Native select arrow visible on dark backgrounds */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%238A95A3' d='M0 0l5 6 5-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

button,
.btn {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    border-radius: 0;
    cursor: pointer;
    transition: border-color 120ms ease, color 120ms ease;
}

button:hover,
.btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

button.primary,
.btn-primary {
    background: transparent;
    border-color: var(--gold);
    color: var(--gold);
}

button.primary:hover,
.btn-primary:hover {
    background: var(--gold);
    color: var(--bg);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: var(--border-2);
    padding: 0;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--gold);
    border-radius: 0;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--gold);
    border-radius: 0;
    border: none;
    cursor: pointer;
}

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 16px 24px;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    border-radius: 0;
    cursor: pointer;
    transition: border-color 120ms ease, color 120ms ease;
}

.tab.active,
.tab[aria-selected="true"] {
    border-color: var(--gold);
    color: var(--gold);
}

.progress-bar {
    position: relative;
    height: 2px;
    background: var(--border);
    width: 100%;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    transition: width 200ms ease;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-3);
    background: transparent;
    border: 1px solid var(--border-2);
    border-radius: 0;
    cursor: pointer;
    transition: color 120ms ease, border-color 120ms ease;
}

.chip:hover {
    color: var(--text-2);
}

.chip.active {
    color: var(--gold);
    border-color: var(--gold);
}

.text-gold {
    color: var(--gold);
}

/* Referenced across the Trade Journal and Playbook grids but never previously defined. */
.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

/* Exact values specified by the user — overrides Bootstrap's own .text-muted (--bs-text-opacity). */
.text-muted {
    --bs-text-opacity: 1;
    color: rgb(185 196 207 / 75%) !important;
}

.text-dim {
    color: var(--text-3);
}

/* Shared zoom/pan image viewer (Components/Shared/ImageViewer.razor) — used by Playbook and Strategies.
   Centralized here rather than in a single module's CSS file since it's now cross-module; see CLAUDE.md's
   label-recipe precedent for why a shared component's styling should live in one place, not be copied. */
.image-viewer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-viewer-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.image-viewer-canvas {
    position: relative;
    height: 480px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.image-viewer-canvas img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    transform-origin: center center;
    touch-action: none;
    user-select: none;
}

.image-viewer-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}
