@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700;800&display=swap');

* {
    box-sizing: border-box;
}

:root {
    --bg: #101010;
    --panel: #141414;
    --panel-2: #151515;
    --line: #252525;
    --line-2: #313131;
    --text: #efefef;
    --muted: #9b9b9b;
    --green: #8ef0aa;
    --red: #ff9898;
    --white: #ffffff;
    --danger-bg: #241718;
    --danger-line: #4b2a2c;
    --danger-soft: #ffb1b1;
}

html,
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Nunito Sans', Arial, Helvetica, sans-serif;
    font-feature-settings: "tnum" 1, "lnum" 1;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* LOGIN */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background:
        radial-gradient(circle at top, rgba(255,255,255,0.03), transparent 35%),
        var(--bg);
}

.login-shell {
    width: 100%;
    max-width: 640px;
    display: flex;
    justify-content: center;
}

.login-form {
    width: 100%;
    max-width: 520px;
}

.login-input-wrap {
    position: relative;
}

.login-input {
    width: 100%;
    height: 72px;
    padding: 0 24px;
    border: 1px solid #2c2c2c;
    border-radius: 8px;
    background: #151515;
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.15px;
    outline: none;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

.login-input::placeholder {
    color: #8a8a8a;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.login-input:focus {
    border-color: #4a4a4a;
    background: #181818;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.035);
}

.login-error {
    margin-top: 12px;
    text-align: center;
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12px;
}

/* SHARED TOP BAR */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 18px;
    min-height: 34px;
}

.top-bar-right {
    position: absolute;
    right: 0;
    top: 0;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    border: 1px solid #343434;
    background: #151515;
    color: #d6d6d6;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16px;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease;
}

.logout-button:hover {
    background: #1a1a1a;
    border-color: #4a4a4a;
    color: #ffffff;
}

.tracker-nav {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.nav-tab {
    position: relative;
    padding: 6px 2px 8px;
    color: #bcbcbc;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18px;
    transition: color 0.14s ease;
}

.nav-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: transparent;
    transition: background 0.14s ease;
}

.nav-tab:hover {
    color: var(--white);
}

.nav-tab.active {
    color: var(--white);
}

.nav-tab.active::after {
    background: var(--white);
}

/* GLOBAL PAGE SHELLS */

.tracker-page,
.notes-page {
    min-height: 100vh;
    padding: 20px 18px 28px;
}

.tracker-shell {
    max-width: 1520px;
    margin: 0 auto;
}

.notes-shell {
    max-width: 1180px;
    margin: 0 auto;
}

/* OVERVIEW */

.overview-hero {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 20px;
    margin-bottom: 18px;
}

.overview-main {
    text-align: center;
    margin-bottom: 16px;
}

.overview-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.08px;
}

.overview-sub {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.12px;
}

.overview-progress {
    max-width: 880px;
    margin: 0 auto;
}

.overview-bar {
    height: 10px;
    background: #1b1b1b;
    border: 1px solid #2a2a2a;
    overflow: hidden;
}

.overview-bar-fill {
    height: 100%;
    background: var(--green);
}

.overview-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #d9d9d9;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.overview-card {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 16px;
}

.overview-card-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08px;
    margin-bottom: 10px;
    color: var(--white);
}

.overview-card-big {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 14px;
}

.overview-card-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #1f1f1f;
    font-size: 13px;
    font-weight: 700;
    color: #dddddd;
}

.overview-card-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* TRACKER */

.control-strip {
    margin: 0 auto 18px;
    max-width: 1180px;
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 10px;
}

.control-form {
    display: grid;
    grid-template-columns: 165px 1fr 1fr 120px 115px;
    gap: 8px;
    align-items: end;
}

.control-item label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.28px;
    text-transform: uppercase;
}

.control-item input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--line-2);
    background: #101010;
    color: var(--white);
    padding: 0 11px;
    font-size: 13px;
    font-weight: 700;
    outline: none;
    transition:
        border-color 0.14s ease,
        box-shadow 0.14s ease,
        background 0.14s ease;
}

.control-item input:focus {
    border-color: #505050;
    background: #121212;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.03);
}

.control-action {
    display: flex;
    align-items: end;
}

.add-button {
    width: 100%;
    height: 38px;
    border: 1px solid #4b4b4b;
    background: #f3f3f3;
    color: #101010;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.18px;
    transition:
        background 0.14s ease,
        transform 0.14s ease,
        opacity 0.14s ease;
}

.add-button:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.table-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

.table-block {
    border: 1px solid var(--line);
    background: var(--panel);
}

.table-title-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #212121;
    background: #151515;
    min-height: 56px;
}

.panel-left-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 24px;
}

.panel-search-toggle,
.panel-delete-toggle,
.panel-delete-toggle-placeholder {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.panel-search-toggle,
.panel-delete-toggle {
    border: 1px solid #3a3a3a;
    background: #131313;
    color: #a8a8a8;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease;
}

.panel-search-toggle:hover,
.panel-delete-toggle:hover {
    border-color: #555555;
    color: #ffffff;
}

.panel-delete-toggle.active {
    background: var(--danger-bg);
    border-color: var(--danger-line);
    color: var(--danger-soft);
}

.panel-search-form {
    display: none;
    align-items: center;
}

.panel-search-form.open {
    display: flex;
}

.panel-search-form input[type="date"] {
    width: 146px;
    height: 30px;
    border: 1px solid #3a3a3a;
    background: #101010;
    color: var(--white);
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    outline: none;
}

.panel-search-form input[type="date"]:focus {
    border-color: #555555;
    background: #121212;
}

.table-title {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
}

.panel-title-inline {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    white-space: nowrap;
    line-height: 1;
}

.panel-title-main {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.12px;
    color: var(--white);
}

.panel-title-stats {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04px;
    font-variant-numeric: tabular-nums;
}

.table-wrap {
    overflow-x: auto;
}

.tracker-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.tracker-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #161616;
    color: #b0b0b0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.28px;
    text-transform: uppercase;
    padding: 12px 10px;
    border-bottom: 1px solid #232323;
    text-align: center;
    vertical-align: middle;
}

.tracker-table tbody td {
    padding: 14px 10px;
    border-bottom: 1px solid #202020;
    font-size: 13px;
    font-weight: 700;
    color: #ededed;
    transition: background 0.12s ease;
    vertical-align: middle;
}

.tracker-table tbody tr:nth-child(even) td {
    background: rgba(255,255,255,0.01);
}

.tracker-table tbody tr:hover td {
    background: rgba(255,255,255,0.025);
}

.tracker-table tbody tr:last-child td {
    border-bottom: none;
}

.col-date {
    width: 130px;
    text-align: center;
    white-space: nowrap;
}

.num {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.col-trades {
    width: 88px;
    text-align: center;
}

.pl-cell,
.percent-cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pl-cell {
    font-weight: 800;
}

.percent-cell {
    font-size: 12px;
    font-weight: 800;
}

.action-col,
.action-cell {
    width: 52px;
    text-align: center;
}

.delete-box {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid #3a3a3a;
    background: #151515;
    color: #ffaaaa;
    font-size: 15px;
    line-height: 1;
    font-weight: 800;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease;
}

.delete-box:hover {
    background: #1a1a1a;
    border-color: #5a5a5a;
    color: #ffd0d0;
}

.delete-box-ghost {
    visibility: hidden;
    pointer-events: none;
}

.row-delete {
    visibility: hidden;
    pointer-events: none;
}

html.delete-mode-notti .row-delete-notti {
    visibility: visible;
    pointer-events: auto;
}

html.delete-mode-byron .row-delete-byron {
    visibility: visible;
    pointer-events: auto;
}

.pos {
    color: var(--green) !important;
}

.neg {
    color: var(--red) !important;
}

/* NOTES */

.notes-composer {
    border: 1px solid var(--line);
    background: var(--panel);
    margin-bottom: 18px;
}

.notes-heading-row {
    border-bottom: 1px solid #212121;
    background: #151515;
    padding: 10px 12px;
}

.notes-heading {
    text-align: center;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.12px;
}

.notes-form-sharp {
    padding: 10px;
}

.notes-textarea {
    width: 100%;
    min-height: 180px;
    border: 1px solid var(--line-2);
    background: #101010;
    color: var(--white);
    padding: 12px 13px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    transition:
        border-color 0.14s ease,
        box-shadow 0.14s ease,
        background 0.14s ease;
}

.notes-textarea::placeholder {
    color: #888888;
    font-weight: 600;
}

.notes-textarea:focus {
    border-color: #505050;
    background: #121212;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.03);
}

.notes-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.note-colour-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.colour-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.colour-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.colour-chip {
    width: 22px;
    height: 22px;
    border: 1px solid #3a3a3a;
    display: inline-block;
    transition:
        transform 0.12s ease,
        border-color 0.12s ease,
        box-shadow 0.12s ease;
}

.colour-option input:checked + .colour-chip {
    border-color: #7a7a7a;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
    transform: translateY(-1px);
}

.colour-black {
    background: #171717;
}

.colour-green {
    background: #1a231d;
}

.colour-blue {
    background: #182028;
}

.colour-red {
    background: #241919;
}

.notes-save-button {
    width: 140px;
}

.notes-board-block {
    border: 1px solid var(--line);
    background: var(--panel);
}

.notes-list-title {
    padding: 10px 12px;
    text-align: center;
    font-size: 17px;
    font-weight: 800;
    border-bottom: 1px solid #212121;
    background: #151515;
    letter-spacing: 0.12px;
}

.sticky-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    align-items: start;
}

.sticky-note {
    height: 220px;
    border: 1px solid #2c2c2c;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition:
        transform 0.12s ease,
        border-color 0.12s ease,
        background 0.12s ease;
}

.sticky-note:hover {
    transform: translateY(-1px);
    border-color: #3c3c3c;
}

.sticky-black {
    background: #151515;
}

.sticky-green {
    background: #172019;
    border-color: #2d3c31;
}

.sticky-blue {
    background: #161d24;
    border-color: #2a3540;
}

.sticky-red {
    background: #211819;
    border-color: #3b2a2c;
}

.sticky-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.sticky-meta {
    min-width: 0;
}

.sticky-user {
    font-size: 13px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 0.08px;
    margin-bottom: 3px;
}

.sticky-date {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.12px;
    text-transform: uppercase;
}

.sticky-body {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.65;
    color: #ececec;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    padding-right: 4px;
    flex: 1;
}

.sticky-body::-webkit-scrollbar {
    width: 8px;
}

.sticky-body::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
}

.sticky-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.14);
}

.sticky-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.22);
}

/* LINKS */

.links-list-block {
    border: 1px solid var(--line);
    background: var(--panel);
}

.links-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #212121;
    background: #151515;
}

.links-list-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.12px;
}

.links-create-button {
    height: 30px;
    padding: 0 12px;
    border: 1px solid #4b4b4b;
    background: #f3f3f3;
    color: #101010;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, transform 0.12s ease;
}

.links-create-button:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.links-rows {
    display: block;
}

.link-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #1f1f1f;
    background: #141414;
    transition: background 0.12s ease;
}

.link-row:hover {
    background: #181818;
}

.link-row:last-child {
    border-bottom: none;
}

.link-row-marker {
    width: 10px;
    height: 44px;
    border: 1px solid #3a3a3a;
    align-self: stretch;
}

.link-row-marker-slate { background: linear-gradient(180deg, #5d6572 0%, #353a42 100%); border-color: #49505a; }
.link-row-marker-blue  { background: linear-gradient(180deg, #6e89c9 0%, #324467 100%); border-color: #52627f; }
.link-row-marker-green { background: linear-gradient(180deg, #73b989 0%, #355240 100%); border-color: #4a6853; }
.link-row-marker-red   { background: linear-gradient(180deg, #cb7777 0%, #663636 100%); border-color: #7a4a4a; }
.link-row-marker-purple{ background: linear-gradient(180deg, #a284d6 0%, #533f74 100%); border-color: #685381; }
.link-row-marker-orange{ background: linear-gradient(180deg, #d39a67 0%, #6d4d31 100%); border-color: #7d5e43; }
.link-row-marker-teal  { background: linear-gradient(180deg, #67b9b0 0%, #2f5b57 100%); border-color: #446c68; }
.link-row-marker-gold  { background: linear-gradient(180deg, #d5be73 0%, #665a31 100%); border-color: #7a6f45; }
.link-row-marker-pink  { background: linear-gradient(180deg, #cf86b1 0%, #6b3d57 100%); border-color: #7c5368; }
.link-row-marker-white { background: linear-gradient(180deg, #d8d8d8 0%, #6f6f6f 100%); border-color: #8a8a8a; }

.link-row-main {
    min-width: 0;
}

.link-row-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 4px;
    color: var(--white);
    word-break: break-word;
}

.link-row-source {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.22px;
    text-transform: uppercase;
    color: #8f8f8f;
    margin-bottom: 8px;
}

.link-row-use {
    font-size: 13px;
    font-weight: 600;
    color: #cfcfcf;
    line-height: 1.55;
    max-width: 92%;
    word-break: break-word;
}

.link-row-use-muted {
    color: var(--muted);
}

.link-row-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.link-open-button {
    height: 32px;
    padding: 0 14px;
    border: 1px solid #4b4b4b;
    background: #f3f3f3;
    color: #101010;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, transform 0.12s ease;
    white-space: nowrap;
}

.link-open-button:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.link-inline-action {
    font-size: 12px;
    font-weight: 700;
    color: #9a9a9a;
    white-space: nowrap;
}

.link-inline-action:hover {
    color: #ffffff;
}

.link-row-editor {
    display: block;
    background: #161616;
}

.link-row-form {
    display: block;
}

.link-row-fields {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 12px;
}

.link-row-field label {
    font-size: 10px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.25px;
    margin-bottom: 4px;
    display: block;
    text-transform: uppercase;
}

.link-row-field input {
    width: 100%;
    height: 38px;
    border: 1px solid #2c2c2c;
    background: #101010;
    color: var(--white);
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
}

.link-row-field input:focus {
    border-color: #505050;
    background: #121212;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.03);
}

.link-colour-row {
    margin-top: 12px;
}

.link-colour-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.25px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.link-colour-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.link-colour-option {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.link-colour-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.link-colour-chip {
    width: 22px;
    height: 22px;
    border: 1px solid #3a3a3a;
    display: inline-block;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        border-color 0.12s ease;
}

.link-colour-option input:checked + .link-colour-chip {
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
    border-color: #909090;
}

.link-colour-slate { background: #4f5662; }
.link-colour-blue  { background: #5f7fcb; }
.link-colour-green { background: #63ab79; }
.link-colour-red   { background: #bf6a6a; }
.link-colour-purple{ background: #9674d4; }
.link-colour-orange{ background: #cf925e; }
.link-colour-teal  { background: #56afa6; }
.link-colour-gold  { background: #cdb362; }
.link-colour-pink  { background: #ca7ca8; }
.link-colour-white { background: #cfcfcf; }

.link-row-actions-edit {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.link-row-save {
    width: auto;
    min-width: 92px;
    padding: 0 14px;
}

.link-row-secondary,
.link-row-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    border: 1px solid #343434;
    background: #121212;
    color: #d8d8d8;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14px;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease;
}

.link-row-secondary:hover {
    background: #171717;
    border-color: #4a4a4a;
    color: #ffffff;
}

.link-row-delete {
    color: #ffb0b0;
    border-color: #4a2a2c;
    background: #1a1213;
}

.link-row-delete:hover {
    background: #241718;
    border-color: #6a3438;
    color: #ffd0d0;
}

/* CALENDAR */

.calendar-shell {
    max-width: 1500px;
}

.calendar-panel {
    border: 1px solid var(--line);
    background: var(--panel);
}

.calendar-topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #212121;
    background: #151515;
}

.calendar-month-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-width: 48px;
    padding: 0 12px;
    border: 1px solid #343434;
    background: #121212;
    color: #d8d8d8;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14px;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.calendar-nav-button:hover {
    background: #171717;
    border-color: #4a4a4a;
    color: #ffffff;
}

.calendar-month-label {
    min-width: 180px;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.12px;
    color: var(--white);
}

.calendar-market-inline {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-market-state,
.calendar-inline-stat {
    border: 1px solid #2a2a2a;
    background: #141414;
    padding: 10px 12px;
}

.calendar-market-state {
    min-width: 240px;
}

.calendar-inline-stat {
    min-width: 130px;
}

.calendar-inline-stat-wide {
    min-width: 180px;
}

.calendar-market-title,
.calendar-inline-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.24px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.calendar-market-sub,
.calendar-inline-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
}

.calendar-market-sub {
    font-size: 13px;
    font-weight: 700;
    color: #d2d2d2;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.calendar-weekday {
    padding: 12px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.25px;
    text-transform: uppercase;
    color: #a5a5a5;
    background: #151515;
    border-bottom: 1px solid #212121;
}

.calendar-day {
    min-height: 138px;
    border-right: 1px solid #1f1f1f;
    border-bottom: 1px solid #1f1f1f;
    padding: 8px;
    background: #141414;
    display: flex;
    flex-direction: column;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day-empty {
    background: #121212;
}

.calendar-day-today {
    background: #171717;
}

.calendar-day-closed {
    background: #131313;
}

.calendar-day-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.calendar-day-number {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #e0e0e0;
}

.calendar-day-status {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.22px;
    text-transform: uppercase;
    color: #8f8f8f;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.calendar-day-note {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 2px;
}

.calendar-entry-pill {
    border: 1px solid #2d2d2d;
    padding: 6px 7px;
    min-width: 0;
}

.calendar-entry-pos {
    background: #1f3326;
    border-color: #345542;
}

.calendar-entry-neg {
    background: #342023;
    border-color: #5d3a40;
}

.calendar-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.calendar-entry-user {
    font-size: 11px;
    font-weight: 800;
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-entry-trades {
    font-size: 10px;
    font-weight: 800;
    color: #c2c2c2;
    flex-shrink: 0;
}

.calendar-entry-body {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.calendar-entry-pl {
    font-size: 12px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
}

.calendar-entry-pct {
    font-size: 11px;
    font-weight: 700;
    color: #d7d7d7;
    line-height: 1.2;
    white-space: nowrap;
}

/* RESPONSIVE */

@media (max-width: 1180px) {
    .control-form {
        grid-template-columns: 1fr 1fr;
    }

    .control-action {
        grid-column: span 2;
    }

    .table-grid {
        grid-template-columns: 1fr;
    }

    .sticky-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-grid {
        grid-template-columns: 1fr 1fr;
    }

    .calendar-topbar {
        grid-template-columns: 1fr;
    }

    .calendar-market-inline {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .calendar-weekday {
        display: none;
    }

    .calendar-day {
        min-height: auto;
    }

    .calendar-market-state,
    .calendar-inline-stat,
    .calendar-inline-stat-wide {
        min-width: 0;
        flex: 1 1 160px;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .tracker-page,
    .notes-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .top-bar {
        position: static;
        display: block;
    }

    .top-bar-right {
        position: static;
        margin-top: 10px;
        display: flex;
        justify-content: center;
    }

    .control-form {
        grid-template-columns: 1fr;
    }

    .control-action {
        grid-column: span 1;
    }

    .login-input {
        height: 64px;
        font-size: 18px;
    }

    .tracker-table {
        min-width: 720px;
    }

    .notes-textarea {
        min-height: 150px;
    }

    .notes-action-row {
        align-items: flex-start;
    }

    .notes-save-button {
        width: 100%;
    }

    .sticky-board {
        grid-template-columns: 1fr;
    }

    .sticky-note {
        height: 210px;
    }

    .links-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .links-create-button {
        width: 100%;
    }

    .link-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .link-row-marker {
        width: 100%;
        height: 8px;
    }

    .link-row-actions,
    .link-row-actions-edit {
        flex-direction: column;
        align-items: stretch;
    }

    .link-open-button,
    .link-row-save,
    .link-row-secondary,
    .link-row-delete {
        width: 100%;
    }

    .calendar-month-controls {
        justify-content: space-between;
    }

    .calendar-month-label {
        min-width: 0;
        flex: 1;
    }

    .calendar-market-inline {
        flex-direction: column;
    }

    .calendar-entry-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .table-title-row {
        grid-template-columns: 1fr;
        gap: 10px;
        justify-items: center;
    }

    .panel-left-tools {
        width: 100%;
        justify-content: center;
    }

    .panel-title-inline {
        flex-wrap: wrap;
        justify-content: center;
    }

    .overview-meta {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
    }
}

/* OVERVIEW / RACE DASHBOARD */

.race-hero {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 18px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
}

.race-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.28px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.race-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.08px;
    line-height: 1.1;
    color: var(--white);
}

.race-sub {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #d2d2d2;
}

.race-hero-right {
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    gap: 10px;
    min-width: 540px;
}

.race-hero-stat {
    border: 1px solid #2a2a2a;
    background: var(--panel-2);
    padding: 12px;
}

.race-hero-stat-wide {
    min-width: 220px;
}

.race-hero-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.24px;
    color: var(--muted);
    margin-bottom: 6px;
}

.race-hero-value {
    font-size: 21px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
}

.race-progress-bar {
    height: 10px;
    background: #1b1b1b;
    border: 1px solid #2a2a2a;
    overflow: hidden;
}

.race-progress-fill {
    height: 100%;
    background: var(--green);
}

.race-progress-meta {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #d9d9d9;
}

.race-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.race-card {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 16px;
}

.race-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.race-card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
}

.race-card-sub {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.race-card-pill {
    border: 1px solid #2d2d2d;
    background: #151515;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18px;
    text-transform: uppercase;
    color: #cfcfcf;
}

.race-card-pill-live {
    border-color: #365143;
    color: var(--green);
}

.race-card-balance {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--white);
    margin-bottom: 12px;
}

.race-card-progress {
    margin-bottom: 14px;
}

.race-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.race-stat-box {
    border: 1px solid #242424;
    background: #151515;
    padding: 10px;
    min-height: 70px;
}

.race-stat-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.22px;
    color: var(--muted);
    margin-bottom: 6px;
}

.race-stat-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
}

.race-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.race-mini-card {
    border: 1px solid #242424;
    background: #151515;
    padding: 10px;
}

.race-mini-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.22px;
    color: var(--muted);
    margin-bottom: 6px;
}

.race-mini-main {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
}

.race-mini-sub {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #cfcfcf;
}

.overview-section {
    margin-bottom: 18px;
}

.overview-section-header {
    border: 1px solid var(--line);
    border-bottom: none;
    background: #151515;
    padding: 12px 14px;
}

.overview-section-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 0.08px;
    line-height: 1.1;
}

.overview-section-sub {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.chart-card {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 14px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #d9d9d9;
}

.chart-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
}

.chart-dot-0 { background: #8ef0aa; }
.chart-dot-1 { background: #8fb7ff; }
.chart-dot-2 { background: #ff9898; }
.chart-dot-3 { background: #d6b0ff; }

.overview-chart-svg {
    width: 100%;
    display: block;
}

.chart-empty {
    border: 1px dashed #343434;
    padding: 26px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.quick-board {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.quick-board-card {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 12px;
}

.quick-board-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.22px;
    color: var(--muted);
    margin-bottom: 6px;
}

.quick-board-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--white);
}

@media (max-width: 1380px) {
    .race-hero {
        grid-template-columns: 1fr;
    }

    .race-hero-right {
        min-width: 0;
    }

    .quick-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .race-cards-grid {
        grid-template-columns: 1fr;
    }

    .race-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .race-hero-right {
        grid-template-columns: 1fr;
    }

    .quick-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .race-title {
        font-size: 24px;
    }

    .race-card-balance {
        font-size: 24px;
    }

    .race-mini-grid,
    .quick-board {
        grid-template-columns: 1fr;
    }

    .race-progress-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}