/* ========== FILTERS BAR ========== */
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.filters-left {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.filters-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.filters-date {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--input-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px 6px;
    transition: border-color 0.2s ease;
}

.filters-date:focus-within {
    border-color: var(--accent);
}

.date-quick {
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    background: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.4;
}

.date-quick:hover {
    color: var(--text-primary);
    background: var(--surface-variant);
}

.date-quick.active {
    background: var(--accent);
    color: #fff;
}

.date-sep-pipe {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

.date-input {
    padding: 3px 6px;
    font-size: 12px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    width: 118px;
}

.date-input:focus {
    outline: none;
}

/* Restore compact inline style for date inputs inside filter pill.
   Needs higher specificity (0,2,1) to override components.css input[type="date"] (0,1,1). */
.filters-date input[type="date"] {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 3px 6px;
    width: 118px;
    font-size: 12px;
}

.date-sep {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
    padding: 0 2px;
}

.filter-select--compact {
    min-width: 130px;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: var(--input-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-select {
    padding: 12px 16px;
    background: var(--input-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    min-width: 160px;
}

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

/* ========== ENTRIES TABLE ========== */
.entries-table-container {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: background 0.4s ease;
}

.entries-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
}

.entries-table th,
.entries-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.entries-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .entries-table th {
    background: rgba(0, 0, 0, 0.2);
}

.entries-table td {
    color: var(--text-primary);
}

.entries-table tr:last-child td {
    border-bottom: none;
}

.entries-table tbody tr {
    cursor: pointer;
}

.entries-table tr:hover td {
    background: var(--accent-glow);
}

.project-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid transparent;
}

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

/* ========== PERIOD TOGGLE ========== */
.period-toggle {
    display: flex;
    gap: 4px;
    background: var(--input-bg);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.period-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.period-btn.active {
    background: var(--accent);
    color: var(--text-on-primary);
}

.period-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--accent-glow);
}

/* ========== PROJECTS STATS ========== */
.projects-stats {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    transition: background 0.4s ease;
}

.projects-stats h2 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--background);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--project-color, var(--accent));
    transition: background 0.2s ease;
}

.project-stat-item:hover {
    background: var(--surface-variant);
}

.project-stat-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.project-stat-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.project-stat-time {
    text-align: right;
}

.project-stat-time .time {
    font-size: 16px;
    font-weight: 700;
    color: var(--project-color, var(--accent));
}

.project-stat-time .percentage {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== EXPORT BOX ========== */
.export-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 32px;
    max-width: 500px;
    transition: background 0.4s ease;
}

.export-date-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-custom-range {
    padding-left: 2px;
}

.export-box h2 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    min-width: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

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

.export-project-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.export-project-stats {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.export-project-stats--empty {
    opacity: 0.5;
}

.export-project-sep {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}


/* ========== PROJECTS MANAGEMENT ========== */
.projects-management {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 24px;
    transition: background 0.4s ease;
}

.projects-management h2 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.groups-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 16px;
}

.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--background);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--group-color, var(--accent));
    transition: background 0.2s ease;
}

.group-item:hover {
    background: var(--surface-variant);
}

.group-item h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========== GROUP CARDS (new design) ========== */
.group-card {
    background: var(--background);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    border-left: 5px solid var(--group-color, var(--accent));
    padding: 18px 20px 14px;
    transition: background 0.2s ease;
    cursor: pointer;
    min-height: 160px;
    display: flex;
    flex-direction: column;
}

.group-card:hover {
    background: var(--surface-variant);
}

.group-card--ungrouped {
    --group-color: var(--text-muted);
    opacity: 0.85;
}

.group-card-header {
    margin-bottom: 12px;
}

.group-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.group-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.group-card-right {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.group-card-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.group-card-projects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.group-project-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 7px;
    background: var(--input-bg);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.group-project-name {
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-project-empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 0;
    grid-column: 1 / -1;
}

.group-project-more {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--input-bg);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    font-style: italic;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--background);
    padding: 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--project-color, var(--accent));
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.project-card:hover {
    background: var(--surface-variant);
}

.project-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.project-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.project-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.project-card-actions {
    display: flex;
    gap: 4px;
}

/* Mini bar chart inside project cards */
.project-mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
    padding-bottom: 2px;
}

.mini-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mini-bar {
    width: 10px;
    background: var(--project-color, var(--accent));
    border-radius: 2px 2px 0 0;
    opacity: 0.75;
    transition: opacity 0.15s ease;
    cursor: default;
}

.mini-bar:hover {
    opacity: 1;
}

.mini-bar-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    line-height: 1;
}

/* Group modal project assignment list */
.group-modal-projects {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.group-modal-project-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 6px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}

.group-modal-project-item:hover {
    background: var(--surface-variant);
}

.group-modal-project-item input[type="checkbox"] {
    flex-shrink: 0;
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.group-modal-empty {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
    font-style: italic;
}

/* ========== ACCOUNT ========== */
.account-info {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 32px;
    max-width: 500px;
    transition: background 0.4s ease;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

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

.info-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.time-format-toggle {
    display: flex;
    gap: 4px;
}

.time-fmt-btn {
    background: var(--surface-variant);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.time-fmt-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.time-fmt-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    cursor: default;
}

.account-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.plan-badge--pro {
    background: rgba(212, 168, 86, 0.15);
    color: var(--warning);
    border: 1px solid rgba(212, 168, 86, 0.35);
}

.plan-badge--free {
    background: var(--input-bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.plan-upgrade-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    margin-left: 8px;
}

.plan-upgrade-link:hover {
    text-decoration: underline;
}

.plan-expiry {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* ========== VOICE BUTTON & PANEL ========== */

.voice-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 900;
    transition: background 0.2s ease, transform 0.15s ease;
}

.voice-fab:hover {
    transform: scale(1.08);
}

.voice-fab.voice-recording {
    background: #ef4444;
    animation: voice-pulse 1.2s ease-in-out infinite;
}

.voice-fab.voice-processing {
    opacity: 0.65;
    cursor: wait;
    pointer-events: none;
}

@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
    50%       { box-shadow: 0 4px 24px rgba(239, 68, 68, 0.55); }
}

.voice-panel {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px 16px;
    z-index: 899;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voice-panel-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 4px;
    transition: color 0.15s ease;
}

.voice-panel-close:hover {
    color: var(--text-primary);
}

.voice-panel-sound {
    position: absolute;
    top: 7px;
    left: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.voice-panel-sound:hover {
    color: var(--text-primary);
}

.voice-panel-sound.muted {
    opacity: 0.45;
}

.voice-transcript {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    min-height: 14px;
}

.voice-reply {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 18px;
}

@media (max-width: 480px) {
    .voice-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .voice-panel {
        bottom: 76px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}

.btn-delete-account {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--error);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-account:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(207, 107, 107, 0.3);
}

/* Filter toggle button — hidden on desktop, shown on mobile via responsive.css */
.filters-toggle-btn {
    display: none;
}

/* ========== MOBILE ENTRY CARDS ========== */
/* Replaces the entries table on screens ≤ 480px */
.entries-cards {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.entry-card {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.entry-card:hover {
    background: var(--accent-glow);
}

.entry-card-color {
    width: 4px;
    flex-shrink: 0;
    align-self: stretch;
    border-radius: var(--radius-lg) 0 0 0;
}

.entry-card-body {
    flex: 1;
    min-width: 0;
    padding: 10px 8px 10px 10px;
}

.entry-card-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 3px;
}

.entry-card-task {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.entry-card-duration {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.entry-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-card-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 8px 8px 0;
    flex-shrink: 0;
}

