/* =====================================================
   Job Tracker -- tracker.css
   ===================================================== */

/* ---- Pipeline summary widget ---- */
.jd-pipeline-summary {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 24px 28px;
    margin: 0 32px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.jd-pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.jd-pipeline-eyebrow {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7a7570;
    margin-bottom: 4px;
}

.jd-pipeline-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 20px;
    font-weight: 400;
    margin: 0;
    color: #1a1814;
    line-height: 1.2;
}

.jd-pipeline-link {
    font-size: 12px;
    font-weight: 700;
    color: #c4622d;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.jd-pipeline-link:hover { color: #1a1814; text-decoration: none; }

.jd-pipeline-stages {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 12px;
}

.jd-pipeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 60px;
}

.jd-pipeline-stage-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.jd-pipeline-stage-count {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.jd-pipeline-stage-label {
    font-size: 10px;
    color: #7a7570;
    text-align: center;
    line-height: 1.3;
}

.jd-pipeline-total {
    font-size: 12px;
    color: #7a7570;
    text-align: right;
}

/* ---- Track button on job cards ---- */
.jd-track-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #7a7570;
    background: #f7f5f0;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.jd-track-btn:hover {
    background: #1a1814;
    color: #fff;
    border-color: #1a1814;
}

.jd-track-btn.jd-tracked {
    background: #e8f5ef;
    color: #1e7e34;
    border-color: #b8dfc9;
}

.jd-track-btn.jd-tracked:hover {
    background: #1e7e34;
    color: #fff;
    border-color: #1e7e34;
}

/* ---- Slide-in panel ---- */
.jd-tracker-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.jd-tracker-panel-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.jd-tracker-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 460px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    font-family: 'DM Sans', system-ui, sans-serif;
}

.jd-tracker-panel.active { right: 0; }

.jd-tracker-panel-head {
    padding: 20px 24px;
    border-bottom: 1px solid #e8e4dc;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    background: #1a1814;
    color: #fff;
}

.jd-tracker-panel-job-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    margin: 0 0 4px;
    color: #fff;
    line-height: 1.3;
}

.jd-tracker-panel-company {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.jd-tracker-panel-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.2s;
}

.jd-tracker-panel-close:hover { color: #fff; }

.jd-tracker-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Stage selector in panel */
.jd-panel-stage-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e4dc;
}

.jd-panel-stage-label {
    font-size: 12px;
    font-weight: 600;
    color: #7a7570;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.jd-panel-stage-select {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1a1814;
    background: #f7f5f0;
    cursor: pointer;
    outline: none;
}

.jd-panel-stage-select:focus { border-color: #c4622d; }

/* Timeline in panel */
.jd-panel-events-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7a7570;
    margin: 0 0 14px;
}

.jd-panel-timeline {
    position: relative;
    margin-bottom: 20px;
}

.jd-panel-event {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    padding-left: 4px;
}

.jd-panel-event::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 22px;
    bottom: -12px;
    width: 1px;
    background: #e8e4dc;
}

.jd-panel-event:last-child::before { display: none; }

.jd-panel-event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c4622d;
    flex-shrink: 0;
    margin-top: 5px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #c4622d;
}

.jd-panel-event-content {
    flex: 1;
    min-width: 0;
}

.jd-panel-event-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.jd-panel-event-type {
    font-size: 13px;
    font-weight: 600;
    color: #1a1814;
}

.jd-panel-event-date {
    font-size: 11px;
    color: #7a7570;
    margin-left: auto;
}

.jd-panel-event-note {
    font-size: 12px;
    color: #7a7570;
    margin: 4px 0 0;
    line-height: 1.5;
}

/* Add event form in panel */
.jd-panel-add-event {
    background: #f7f5f0;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
}

.jd-panel-add-event-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7a7570;
    margin: 0 0 12px;
}

.jd-panel-add-event select,
.jd-panel-add-event input[type="date"],
.jd-panel-add-event textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    color: #1a1814;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    margin-bottom: 8px;
}

.jd-panel-add-event select:focus,
.jd-panel-add-event input:focus,
.jd-panel-add-event textarea:focus { border-color: #c4622d; }

.jd-panel-add-event textarea { resize: vertical; rows: 2; }

.jd-panel-save-event-btn {
    width: 100%;
    padding: 9px;
    background: #1a1814;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.jd-panel-save-event-btn:hover { background: #c4622d; }

/* ---- Full tracker page ---- */
.jd-tracker-wrap {
    font-family: 'DM Sans', system-ui, sans-serif;
}

.jd-tracker-header {
    background: #1a1814;
    padding: 48px 40px 40px;
}

.jd-tracker-header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.jd-tracker-counts {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.jd-tracker-count-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.jd-tracker-count-num {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 28px;
    line-height: 1;
    font-weight: 400;
}

.jd-tracker-count-label {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.jd-tracker-stage-section {
    padding: 28px 32px;
    border-bottom: 1px solid #e8e4dc;
}

.jd-tracker-stage-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid;
    padding-left: 12px;
    margin-bottom: 16px;
}

.jd-tracker-stage-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.jd-tracker-stage-count {
    font-size: 12px;
    color: #7a7570;
    background: #f7f5f0;
    border: 1px solid #e8e4dc;
    border-radius: 100px;
    padding: 1px 8px;
}

.jd-tracker-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.jd-tracker-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.jd-tracker-card-top {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.jd-tracker-card-source {
    font-size: 10px;
    color: #7a7570;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.jd-tracker-card-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 16px;
    font-weight: 400;
    margin: 0 0 4px;
    line-height: 1.3;
}

.jd-tracker-card-title a {
    color: #1a1814;
    text-decoration: none;
}

.jd-tracker-card-title a:hover { color: #c4622d; }

.jd-tracker-card-company {
    font-size: 12px;
    font-weight: 600;
    color: #1a1814;
}

.jd-tracker-card-location {
    font-weight: 400;
    color: #7a7570;
}

.jd-tracker-card-salary {
    font-size: 11px;
    color: #7a7570;
    margin-top: 4px;
}

.jd-tracker-card-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.jd-stage-select {
    padding: 5px 8px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 12px;
    color: #1a1814;
    background: #f7f5f0;
    cursor: pointer;
    outline: none;
    max-width: 130px;
}

.jd-delete-app {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.jd-delete-app:hover { color: #cc1818; }

/* Events timeline on tracker page */
.jd-tracker-events {
    border-left: 2px solid #f0ede8;
    margin-left: 5px;
    padding-left: 16px;
    margin-bottom: 14px;
}

.jd-tracker-event {
    position: relative;
    margin-bottom: 10px;
}

.jd-tracker-event-dot {
    position: absolute;
    left: -21px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c4622d;
    border: 2px solid #fff;
}

.jd-tracker-event-body {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.jd-tracker-event-type {
    font-size: 12px;
    font-weight: 600;
    color: #1a1814;
}

.jd-tracker-event-date {
    font-size: 11px;
    color: #7a7570;
}

.jd-tracker-event-note {
    width: 100%;
    font-size: 12px;
    color: #7a7570;
    margin: 2px 0 0;
    line-height: 1.5;
}

/* Add event form on tracker page */
.jd-add-event-form {
    background: #f7f5f0;
    border-radius: 8px;
    padding: 12px;
}

.jd-add-event-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.jd-add-event-row select,
.jd-add-event-row input[type="date"] {
    flex: 1;
    min-width: 120px;
    padding: 6px 8px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    outline: none;
}

.jd-add-event-btn {
    padding: 6px 14px;
    background: #1a1814;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.jd-add-event-btn:hover { background: #c4622d; }

.jd-event-note-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    box-sizing: border-box;
    resize: vertical;
    outline: none;
}

.jd-event-note-input:focus,
.jd-add-event-row select:focus,
.jd-add-event-row input:focus { border-color: #c4622d; }

@media ( max-width: 640px ) {
    .jd-tracker-header { padding: 32px 20px; }
    .jd-tracker-stage-section { padding: 20px; }
    .jd-tracker-cards { grid-template-columns: 1fr; }
    .jd-pipeline-summary { margin: 0 20px; }
}
