/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0f172a;
    --surface:   #1e293b;
    --border:    #334155;
    --accent:    #6366f1;
    --accent-dim:#4f46e5;
    --text:      #f1f5f9;
    --muted:     #94a3b8;
    --green:     #10b981;
    --red:       #ef4444;
    --amber:     #f59e0b;
    --radius:    10px;
    --font:      'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    min-height: 100vh;
}

button { font-family: var(--font); cursor: pointer; }
select { font-family: var(--font); }
input  { font-family: var(--font); }

/* ── Header ───────────────────────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    height: 52px;
    background: linear-gradient(180deg, #243044 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.unassigned-badge {
    display: none;
    align-items: center;
    gap: 0.35rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--amber);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-right: 0.5rem;
    cursor: default;
}

/* ── Tab buttons ──────────────────────────────────────────────────────────── */
.tab-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    transition: color 0.15s;
    position: relative;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
    color: var(--accent);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

/* ── Tab content ──────────────────────────────────────────────────────────── */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Two-column layout ────────────────────────────────────────────────────── */
#tab-track.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 52px);
    overflow: hidden;
}

.track-columns {
    display: grid;
    grid-template-columns: 1fr 320px;
    flex: 1;
    overflow: hidden;
}

.col-projects {
    padding: 1.25rem;
    overflow-y: auto;
    border-right: 1px solid var(--border);
}

.col-today {
    padding: 1.25rem;
    overflow-y: auto;
}

.col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.6rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

/* ── Running strip ────────────────────────────────────────────────────────── */
.running-strip {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1.25rem;
    background: var(--surface);
    border-bottom: 2px solid var(--green);
    position: sticky;
    top: 52px;
    z-index: 90;
}

.running-strip.active {
    display: flex;
    box-shadow: 0 2px 16px rgba(16, 185, 129, 0.12);
}

.running-strip-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.running-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.running-project-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.running-strip-label {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timer-display-strip {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    flex-shrink: 0;
}

.timer-display-strip.unassigned { color: var(--amber); }

.btn-stop-strip {
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.btn-stop-strip:hover { background: #dc2626; }

/* ── Section label ────────────────────────────────────────────────────────── */
.section-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
}

.projects-empty,
.today-empty {
    text-align: center;
    color: var(--muted);
    padding: 2rem 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

.projects-empty-icon,
.today-empty-icon {
    display: block;
    font-size: 1.75rem;
    margin-bottom: 0.6rem;
    opacity: 0.6;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.project-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-add-task {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.btn-add-task:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-archive {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
}

.project-card:hover .btn-archive,
.task-row:hover .btn-archive {
    opacity: 1;
}

.btn-archive:hover { color: var(--red); }

.project-tasks {
    padding: 0.25rem 0;
}

.task-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    transition: background 0.1s;
}

.task-row:last-child { border-bottom: none; }

.task-row:hover { background: rgba(255,255,255,0.03); }

.task-name {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text);
}

.btn-task-start {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 28px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}

.btn-task-start:hover { background: var(--accent-dim); transform: scale(1.05); }

.no-tasks-hint {
    font-size: 0.82rem;
    color: var(--muted);
    padding: 0.65rem 1rem;
    font-style: italic;
}

/* ── Today section ────────────────────────────────────────────────────────── */
.today-total {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
}


/* ── Entry rows ───────────────────────────────────────────────────────────── */
.entry-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.entry-row:last-child { border-bottom: none; }

.entry-row:hover { background: rgba(255,255,255,0.03); }

.entry-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.entry-dot.unassigned { background: var(--amber); }

.entry-label {
    flex: 1;
    font-size: 0.9rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-label.unassigned {
    color: var(--amber);
    font-style: italic;
}

.entry-tag-now {
    display: inline-flex;
    align-items: center;
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.35);
    color: var(--amber);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.entry-tag-now:hover { background: rgba(245,158,11,0.22); }

.entry-meta {
    text-align: right;
    flex-shrink: 0;
}

.entry-duration {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.entry-time {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 1px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    border: none;
    border-radius: 7px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-dim); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

/* ── Modals ───────────────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.modal p {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.modal-field {
    margin-bottom: 1rem;
}

.modal-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.modal-field input,
.modal-field select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 7px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
}

.modal-field input:focus,
.modal-field select:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1e293b;
    color: var(--text);
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }

/* ── Nudge banner ─────────────────────────────────────────────────────────── */
.nudge-banner {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 900;
    align-items: center;
    gap: 0.75rem;
    max-width: 480px;
    width: calc(100% - 2rem);
}

.nudge-banner-text { flex: 1; font-size: 0.88rem; }

.nudge-cta {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.nudge-dismiss {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

/* ── Stub tab card ────────────────────────────────────────────────────────── */
.stub-card {
    max-width: 380px;
    margin: 4rem auto;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2.5rem 2rem;
}

.stub-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.stub-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.stub-card p {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

.stub-badge {
    display: inline-block;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.3);
    color: var(--accent);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ── Upgrade modal features list ──────────────────────────────────────────── */
.upgrade-features {
    list-style: none;
    margin: 0.5rem 0 1.25rem;
}

.upgrade-features li {
    font-size: 0.88rem;
    color: var(--muted);
    padding: 0.25rem 0;
}

.upgrade-features li::before {
    content: '✓ ';
    color: var(--green);
    font-weight: 700;
}

.upgrade-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.upgrade-note {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

/* ── Log tab ──────────────────────────────────────────────────────────────── */
.log-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.25rem;
}

.log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.log-range-btns {
    display: flex;
    gap: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.log-range-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.3rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.log-range-btn:hover { color: var(--text); }

.log-range-btn.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.log-empty {
    text-align: center;
    color: var(--muted);
    padding: 3rem 0;
    font-size: 0.9rem;
}

.log-group { margin-bottom: 1.5rem; }

.log-date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.log-date-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.log-date-total {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
}

.log-entry-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.5rem;
    border-radius: 7px;
    transition: background 0.1s;
}

.log-entry-row:hover { background: rgba(255,255,255,0.04); }

.log-entry-row:hover .log-entry-actions { opacity: 1; }

.log-entry-row.editing {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    display: block;
}

.log-entry-label {
    flex: 1;
    font-size: 0.88rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-entry-label.unassigned { color: var(--amber); font-style: italic; }

.log-manual-tag {
    display: inline-block;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    color: var(--accent);
    border-radius: 10px;
    padding: 0px 6px;
    font-size: 0.68rem;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.log-entry-notes {
    font-size: 0.78rem;
    color: var(--muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    flex-shrink: 0;
}

.log-entry-meta {
    text-align: right;
    flex-shrink: 0;
}

.log-entry-actions {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.btn-log-action {
    background: none;
    border: 1px solid transparent;
    color: var(--muted);
    border-radius: 5px;
    width: 26px;
    height: 26px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
}

.btn-log-action:hover { color: var(--text); border-color: var(--border); }

.btn-log-delete:hover { color: var(--red); border-color: rgba(239,68,68,0.3); }

/* ── Inline edit ──────────────────────────────────────────────────────────── */
.inline-edit-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.inline-select,
.inline-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.83rem;
    font-family: var(--font);
}

.inline-select:focus,
.inline-input:focus {
    outline: none;
    border-color: var(--accent);
}

.inline-notes { flex: 1; min-width: 160px; }

.inline-edit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ── Manual entry modal ───────────────────────────────────────────────────── */
.modal-row {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 0;
}

.modal-row .modal-field { flex: 1; }

/* ── Report tab ───────────────────────────────────────────────────────────── */
.report-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.25rem;
}

.report-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.custom-range-picker {
    display: none;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.custom-range-picker.active { display: flex; }

.custom-range-picker input[type="date"] {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 7px;
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
    font-family: var(--font);
}

.range-sep { font-size: 0.82rem; color: var(--muted); }

.report-range-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.3rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.report-range-btn:hover { color: var(--text); }

.report-range-btn.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* Stat cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
}

/* Report sections */
.report-section { margin-bottom: 1.75rem; }

/* Bar chart */
.project-bars { padding-top: 0.5rem; }

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.chart-bar-label {
    font-size: 0.85rem;
    width: 130px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.chart-bar-track {
    flex: 1;
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 5px;
    min-width: 2px;
    transition: width 0.4s ease;
}

.chart-bar-value {
    font-size: 0.82rem;
    color: var(--muted);
    width: 56px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Breakdown */
.breakdown-project { margin-bottom: 0.25rem; }

.breakdown-proj-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.5rem;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.1s;
}

.breakdown-proj-row:hover { background: rgba(255,255,255,0.04); }

.breakdown-proj-name { flex: 1; font-size: 0.9rem; font-weight: 500; }

.breakdown-billable { font-size: 0.82rem; color: var(--green); font-weight: 600; flex-shrink: 0; }

.breakdown-proj-secs { font-size: 0.88rem; font-weight: 600; flex-shrink: 0; font-variant-numeric: tabular-nums; }

.breakdown-chevron { font-size: 0.75rem; color: var(--muted); flex-shrink: 0; width: 16px; }

.breakdown-tasks {
    display: none;
    padding: 0.1rem 0 0.4rem 1.75rem;
}

.breakdown-project.expanded .breakdown-tasks { display: block; }

.breakdown-task-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.3rem 0.5rem;
}

.breakdown-task-name { flex: 1; font-size: 0.83rem; color: var(--muted); }

.breakdown-task-secs { font-size: 0.82rem; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* Project rate button */
.btn-project-rate {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.btn-project-rate:hover { color: var(--green); border-color: var(--green); }
.btn-project-rate.has-rate { color: var(--green); border-color: rgba(16,185,129,0.3); }

/* ── Command palette ──────────────────────────────────────────────────────── */
.cmd-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.cmd-overlay.show { display: flex; }

.cmd-palette {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    overflow: hidden;
}

.cmd-search-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.cmd-search-icon {
    font-size: 1.1rem;
    color: var(--muted);
    flex-shrink: 0;
}

.cmd-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
}

.cmd-input::placeholder { color: var(--muted); }

.cmd-esc {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 5px;
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
    cursor: pointer;
    flex-shrink: 0;
}

.cmd-results {
    max-height: 340px;
    overflow-y: auto;
    padding: 0.35rem 0;
}

.cmd-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 0.5rem 1rem 0.2rem;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: background 0.1s;
    border-radius: 0;
}

.cmd-item:hover,
.cmd-item.active { background: rgba(99,102,241,0.12); }

.cmd-item-icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: var(--muted);
}

.cmd-item-body { flex: 1; min-width: 0; }

.cmd-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.cmd-item-sub {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 1px;
}

.cmd-item-hint {
    font-size: 0.72rem;
    color: var(--muted);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.1s;
}

.cmd-item:hover .cmd-item-hint,
.cmd-item.active .cmd-item-hint { opacity: 1; }

.cmd-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #tab-track.active {
        height: auto;
        overflow: visible;
    }
    .track-columns {
        grid-template-columns: 1fr;
        overflow: visible;
        height: auto;
    }
    .col-projects {
        overflow-y: visible;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .col-today { overflow-y: visible; }
    .running-strip { position: static; }
}

@media (max-width: 480px) {
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
    .running-strip-label { display: none; }
    .stat-cards { grid-template-columns: 1fr; }
    .chart-bar-label { width: 90px; }
}
