/* ═══════════════════════════════════════════════════════════════════════════
   Track — Outreach CRM
   Accent: #f97316 (orange-500)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page shell ─────────────────────────────────────────────────────────── */
.track-page {
    background: #150800;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    margin-bottom: -96px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.track-header {
    background: linear-gradient(140deg, #160800 0%, #2d1400 55%, #1a0900 100%);
    border-bottom: 1px solid rgba(249, 115, 22, 0.18);
    position: relative;
    margin: -60px 0 -110px 0;
}

.track-header .back-to-store-btn {
    display: inline-flex !important;
    width: auto;
    align-self: flex-start;
}

/* Glow orb */
.track-header::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -120px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.09) 0%, transparent 65%);
    pointer-events: none;
}

.track-header__body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    /* padding: 16px 0 20px; */
}

.track-header__badge {
    display: inline-flex;
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.30);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 12px;
    margin-bottom: 10px;
}

.track-header__title {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.track-header__subtitle {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.50);
    margin: 0;
    max-width: 560px;
    line-height: 1.6;
}

.track-header__chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.track-chip {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.70);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 14px;
}

.track-chip--closed {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.28);
    color: #10b981;
}

.track-chip--overdue {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: #f87171;
}

.track-hiw-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.50);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.track-hiw-btn:hover {
    background: rgba(249, 115, 22, 0.14);
    color: #fb923c;
    border-color: rgba(249, 115, 22, 0.35);
}

/* ── Light mode header ──────────────────────────────────────────────────── */
html[data-theme="light"] .track-page { background: #fff7ed; }
html[data-theme="light"] .track-header {
    background: linear-gradient(140deg, #fff7ed 0%, #ffedd5 55%, #fef3e2 100%);
    border-bottom: 1px solid rgba(249, 115, 22, 0.20);
}
html[data-theme="light"] .track-header::before {
    background: radial-gradient(circle, rgba(249, 115, 22, 0.06) 0%, transparent 65%);
}
html[data-theme="light"] .track-header__badge { background: rgba(249, 115, 22, 0.15); color: #c2410c; border-color: rgba(249, 115, 22, 0.35); }
html[data-theme="light"] .track-header__title { color: #1c0a00; }
html[data-theme="light"] .track-header__subtitle { color: rgba(0, 0, 0, 0.50); }
html[data-theme="light"] .track-chip {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.10);
    color: rgba(0, 0, 0, 0.65);
}
html[data-theme="light"] .track-hiw-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.50);
}
html[data-theme="light"] .track-hiw-btn:hover {
    background: rgba(249, 115, 22, 0.10);
    color: #ea6f00;
    border-color: rgba(249, 115, 22, 0.30);
}

/* ── Body ───────────────────────────────────────────────────────────────── */
.track-body.container {
    padding-top: 80px;
    padding-bottom: 80px;
    min-height: 0;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.track-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.track-add-btn {
    background: linear-gradient(135deg, #f97316 0%, #ea6400 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.track-add-btn:hover { opacity: 0.88; }

.track-lost-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    user-select: none;
}
.track-lost-toggle input { cursor: pointer; accent-color: #f97316; }
html[data-theme="light"] .track-lost-toggle { color: rgba(0, 0, 0, 0.45); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.track-empty-state {
    text-align: center;
    padding: 80px 20px;
}
.track-empty-state__icon { font-size: 2.5rem; margin-bottom: 16px; }
.track-empty-state__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.80);
    margin: 0 0 10px;
}
.track-empty-state__sub {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.40);
    max-width: 400px;
    margin: 0 auto 24px;
    line-height: 1.6;
}
.track-empty-state__sub--error { color: #f87171; }
.track-cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, #f97316 0%, #ea6400 100%);
    color: #fff;
    border-radius: 999px;
    padding: 9px 24px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s;
}
.track-cta-btn:hover { opacity: 0.88; color: #fff; text-decoration: none; }

html[data-theme="light"] .track-empty-state__title { color: rgba(0, 0, 0, 0.80); }
html[data-theme="light"] .track-empty-state__sub { color: rgba(0, 0, 0, 0.40); }

/* ── Board ───────────────────────────────────────────────────────────────── */
.track-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    align-items: start;
}

/* ── Column ──────────────────────────────────────────────────────────────── */
.track-column {
    min-height: 120px;
}

.track-column__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-left: 3px solid;
    border-radius: 0 8px 0 0;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 12px;
}

.track-column__label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.track-column__count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.track-column__empty {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.22);
    text-align: center;
    padding: 20px 0;
    margin: 0;
}

.track-column__cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

html[data-theme="light"] .track-column__head { background: rgba(0, 0, 0, 0.03); }
html[data-theme="light"] .track-column__empty { color: rgba(0, 0, 0, 0.25); }

/* ── Contact card ────────────────────────────────────────────────────────── */
.track-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.track-card:hover {
    background: rgba(249, 115, 22, 0.07);
    border-color: rgba(249, 115, 22, 0.22);
}

.track-card__top {
    display: flex;
    gap: 10px;
    align-items: center;
}

.track-card__avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(249, 115, 22, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fb923c;
}
.track-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-card__info { overflow: hidden; }
.track-card__name {
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-card__meta {
    font-size: 0.74rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-card__platform { font-weight: 600; }
.track-card__handle { color: rgba(255, 255, 255, 0.40); }

.track-card__channel {
    font-size: 0.70rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.50);
    align-self: flex-start;
}

.track-card__due {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
}
.track-card__due.overdue { color: #f87171; }

.track-card__notes {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.38);
    margin: 0;
    line-height: 1.5;
}

.track-card__deal {
    font-size: 0.74rem;
    font-weight: 700;
    color: #10b981;
    align-self: flex-start;
}

.track-card__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 8px;
}
.track-card__nav-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.40);
    width: 24px;
    height: 24px;
    border-radius: 999px;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.track-card__nav-btn:disabled {
    opacity: 0.20;
    cursor: not-allowed;
}
.track-card__nav-btn:not(:disabled):hover {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border-color: rgba(249, 115, 22, 0.30);
}
.track-card__stage-label {
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Light mode cards */
html[data-theme="light"] .track-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .track-card:hover {
    background: rgba(249, 115, 22, 0.06);
    border-color: rgba(249, 115, 22, 0.20);
}
html[data-theme="light"] .track-card__name { color: rgba(0, 0, 0, 0.85); }
html[data-theme="light"] .track-card__handle { color: rgba(0, 0, 0, 0.35); }
html[data-theme="light"] .track-card__notes { color: rgba(0, 0, 0, 0.38); }
html[data-theme="light"] .track-card__nav { border-top-color: rgba(0, 0, 0, 0.07); }
html[data-theme="light"] .track-card__nav-btn {
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.40);
}

/* ── Add/Edit modal ──────────────────────────────────────────────────────── */
.track-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.track-modal {
    background: #1e1008;
    border: 1px solid rgba(249, 115, 22, 0.18);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.track-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.track-modal__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.track-modal__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s;
}
.track-modal__close:hover { color: #fff; }

/* Scout search inside modal */
.track-scout-wrap { position: relative; }
.track-or {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.28);
    text-align: center;
    margin: 8px 0 0;
}

/* Dropdown */
.track-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1e1008;
    border: 1px solid rgba(249, 115, 22, 0.25);
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 10;
}
.track-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.12s;
}
.track-dropdown__item:hover { background: rgba(249, 115, 22, 0.10); }
.track-dropdown__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(249, 115, 22, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fb923c;
    flex-shrink: 0;
}
.track-dropdown__avatar img { width: 100%; height: 100%; object-fit: cover; }
.track-dropdown__name { font-size: 0.83rem; font-weight: 600; color: rgba(255,255,255,0.85); display: block; }
.track-dropdown__meta { font-size: 0.72rem; color: rgba(255,255,255,0.40); display: block; }

/* Modal fields */
.track-modal__fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.track-modal__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.track-modal__section-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 4px;
}

.track-input-group { display: flex; flex-direction: column; gap: 4px; }
.track-input-label { font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.35); }

.track-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    padding: 9px 12px;
    outline: none;
    width: 100%;
    transition: border-color 0.15s;
}
.track-input:focus { border-color: rgba(249, 115, 22, 0.50); }
.track-input::placeholder { color: rgba(255, 255, 255, 0.25); }
.track-input--date::-webkit-calendar-picker-indicator { filter: invert(0.5); cursor: pointer; }

.track-textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    padding: 9px 12px;
    outline: none;
    resize: vertical;
    width: 100%;
    transition: border-color 0.15s;
    font-family: inherit;
}
.track-textarea:focus { border-color: rgba(249, 115, 22, 0.50); }
.track-textarea::placeholder { color: rgba(255, 255, 255, 0.25); }

/* Stage / channel pill group in modal */
.track-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.track-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.50);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.track-pill.active {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.40);
    color: #fb923c;
}
.track-pill:not(.active):hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
}

/* Modal actions */
.track-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}
.track-save-error {
    font-size: 0.82rem;
    color: #f87171;
    margin: -4px 0 0;
}
.track-save-btn {
    background: linear-gradient(135deg, #f97316 0%, #ea6400 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 9px 22px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.track-save-btn:hover:not(:disabled) { opacity: 0.88; }
.track-save-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.track-delete-btn {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-right: auto;
}
.track-delete-btn:hover { background: rgba(239, 68, 68, 0.20); }

/* ── Light mode modal ───────────────────────────────────────────────────── */
html[data-theme="light"] .track-modal {
    background: #ffffff;
    border-color: rgba(249, 115, 22, 0.20);
}
html[data-theme="light"] .track-modal__title { color: #1c0a00; }
html[data-theme="light"] .track-modal__close { color: rgba(0, 0, 0, 0.40); }
html[data-theme="light"] .track-modal__close:hover { color: #000; }
html[data-theme="light"] .track-or { color: rgba(0, 0, 0, 0.28); }
html[data-theme="light"] .track-modal__section-label { color: rgba(0, 0, 0, 0.40); }
html[data-theme="light"] .track-input-label { color: rgba(0, 0, 0, 0.40); }
html[data-theme="light"] .track-input,
html[data-theme="light"] .track-textarea {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.85);
}
html[data-theme="light"] .track-input::placeholder,
html[data-theme="light"] .track-textarea::placeholder { color: rgba(0, 0, 0, 0.30); }
html[data-theme="light"] .track-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
    color: rgba(0, 0, 0, 0.50);
}
html[data-theme="light"] .track-dropdown {
    background: #fff;
    border-color: rgba(249, 115, 22, 0.20);
}
html[data-theme="light"] .track-dropdown__name { color: rgba(0, 0, 0, 0.80); }
html[data-theme="light"] .track-dropdown__meta { color: rgba(0, 0, 0, 0.40); }

/* ── How It Works modal ──────────────────────────────────────────────────── */
.track-hiw-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.track-hiw-modal {
    background: #1e1008;
    border: 1px solid rgba(249, 115, 22, 0.20);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.track-hiw-modal__close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.40);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.15s;
}
.track-hiw-modal__close:hover { color: #fff; }

.track-hiw-modal__header { border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 20px; }
.track-hiw-modal__eyebrow {
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fb923c;
    margin: 0 0 8px;
}
.track-hiw-modal__title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px;
}
.track-hiw-modal__subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.50);
    margin: 0;
    line-height: 1.6;
}

.track-hiw-section { display: flex; flex-direction: column; gap: 8px; }
.track-hiw-section__head { display: flex; align-items: center; gap: 10px; }
.track-hiw-section__icon { font-size: 1.1rem; }
.track-hiw-section__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
}
.track-hiw-section__body {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.50);
    line-height: 1.65;
    margin: 0;
}

html[data-theme="light"] .track-hiw-modal {
    background: #fff;
    border-color: rgba(249, 115, 22, 0.18);
}
html[data-theme="light"] .track-hiw-modal__close { color: rgba(0, 0, 0, 0.40); }
html[data-theme="light"] .track-hiw-modal__close:hover { color: #000; }
html[data-theme="light"] .track-hiw-modal__header { border-bottom-color: rgba(0, 0, 0, 0.08); }
html[data-theme="light"] .track-hiw-modal__title { color: #1c0a00; }
html[data-theme="light"] .track-hiw-modal__subtitle { color: rgba(0, 0, 0, 0.50); }
html[data-theme="light"] .track-hiw-section__title { color: rgba(0, 0, 0, 0.80); }
html[data-theme="light"] .track-hiw-section__body { color: rgba(0, 0, 0, 0.50); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .track-board {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 600px) {
    .track-board {
        grid-template-columns: 1fr;
    }
    .track-modal__row { grid-template-columns: 1fr; }
    .track-header__body { flex-direction: column; align-items: flex-start; gap: 12px; }
}
