/* ============================================
   PITCHU TACHES - Design Mobile-First
   ============================================ */

:root {
    --bg: #f0f4f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f7faf7;
    --accent: #22c55e;
    --accent-light: #dcfce7;
    --accent-dark: #16a34a;
    --accent2: #3b82f6;
    --accent2-light: #dbeafe;
    --pawel: #8b5cf6;
    --pawel-light: #ede9fe;
    --seb: #f59e0b;
    --seb-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --text: #1a2e1a;
    --text-secondary: #5a7a5a;
    --text-muted: #94b894;
    --border: #d4e8d4;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 9999px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.header-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #059669);
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    box-shadow: var(--shadow-sm);
}

.menu-toggle {
    cursor: pointer;
}

.menu-toggle-text {
    cursor: pointer;
}

.menu-toggle:active {
    transform: scale(0.98);
}

.header-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-dark), #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.header-user {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-icon:hover, .btn-icon:active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1.25rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), #059669);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
    box-shadow: var(--shadow);
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
}

.login-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.form-group {
    text-align: left;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    transition: all 0.2s;
    -webkit-appearance: none;
}

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

.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    margin-top: 0.5rem;
}

.btn-primary:hover, .btn-primary:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    display: none;
    background: var(--danger-light);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 1rem;
    text-align: center;
}

.login-error.visible { display: block; }

/* ============================================
   MAIN CONTENT (TIMER PAGE)
   ============================================ */
.app-main {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.25rem;
}

/* ============================================
   TIMER SECTION
   ============================================ */
.timer-section {
    text-align: center;
    padding: 1.5rem 0;
}

.timer-display {
    font-size: 4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.timer-display.running {
    color: var(--accent-dark);
}

.timer-status {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.timer-status.running {
    color: var(--accent);
    font-weight: 600;
}

.timer-btn {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: none;
    font-size: 1.125rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.timer-btn.start {
    background: linear-gradient(135deg, var(--accent), #059669);
    color: white;
}

.timer-btn.start:hover, .timer-btn.start:active {
    transform: scale(1.05);
    box-shadow: 0 16px 40px rgba(34, 197, 94, 0.35);
}

.timer-btn.stop {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    animation: pulse-ring 2s ease-in-out infinite;
}

.timer-btn.stop:hover, .timer-btn.stop:active {
    transform: scale(1.05);
    box-shadow: 0 16px 40px rgba(239, 68, 68, 0.35);
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4), var(--shadow-lg); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0), var(--shadow-lg); }
}

/* ============================================
   SAVE FORM (after stopping timer)
   ============================================ */
.save-form {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease-out;
}

.save-form.visible { display: block; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.save-form h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.save-summary-item {
    flex: 1;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    text-align: center;
}

.save-summary-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.save-summary-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-dark);
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cat-btn {
    padding: 0.625rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.cat-btn:hover, .cat-btn:active {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--accent-light);
}

.cat-btn.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent-dark);
    font-weight: 600;
}

.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s;
    -webkit-appearance: none;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.save-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-save {
    flex: 1;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.btn-save:hover, .btn-save:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-cancel {
    padding: 0.875rem 1.25rem;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover, .btn-cancel:active {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

/* ============================================
   TODAY'S SESSIONS
   ============================================ */
.today-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-badge {
    background: var(--accent-light);
    color: var(--accent-dark);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
}

.session-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.session-card:active {
    background: var(--bg-card-hover);
}

.session-card.live {
    border-color: #fca5a5;
    background: #fff5f5;
}

.session-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.session-avatar.pawel { background: linear-gradient(135deg, var(--pawel), #7c3aed); }
.session-avatar.seb { background: linear-gradient(135deg, var(--seb), #d97706); }

.session-info {
    flex: 1;
    min-width: 0;
}

.session-cat {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.session-desc {
    font-size: 0.875rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.session-duration {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.session-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.manual-tag {
    display: inline-block;
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--accent2-light);
    color: var(--accent2);
    vertical-align: middle;
}

.live-tag {
    display: inline-block;
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #fee2e2;
    color: #dc2626;
    vertical-align: middle;
}

.modified-tag {
    display: inline-block;
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #fff7ed;
    color: #c2410c;
    vertical-align: middle;
}

.modified-tag.with-tooltip {
    position: relative;
    cursor: help;
}

.modified-tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: 120%;
    min-width: 260px;
    max-width: 360px;
    padding: 0.6rem;
    border-radius: 10px;
    background: #111827;
    color: #f9fafb;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    text-transform: none;
    letter-spacing: 0;
}

.modified-tag.with-tooltip:hover .modified-tooltip,
.modified-tag.with-tooltip:active .modified-tooltip {
    display: block;
}

.modified-tooltip-item {
    font-size: 0.7rem;
    line-height: 1.35;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.modified-tooltip-item:last-child {
    border-bottom: none;
}

.deleted-tag {
    display: inline-block;
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #fee2e2;
    color: #b91c1c;
    vertical-align: middle;
}

.deleted-session-card {
    border-color: #fecaca;
    background: #fffbfb;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.empty-state p {
    font-size: 0.875rem;
}

.day-separator {
    padding: 0.5rem 0.25rem;
    margin: 0.75rem 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================
   STATS PAGE
   ============================================ */
.stats-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.375rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .stats-filters {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.extra-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.filter-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.8125rem;
    font-family: inherit;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.filter-btn {
    padding: 0.625rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.filter-btn:not(.active):hover {
    background: var(--bg);
}

/* Balance card */
.balance-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.balance-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    text-align: center;
}

.balance-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.balance-person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.balance-name {
    width: 80px;
    font-size: 0.8125rem;
    font-weight: 600;
    flex-shrink: 0;
}

.balance-bar-track {
    flex: 1;
    height: 28px;
    background: var(--bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.balance-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    transition: width 0.6s ease-out;
    min-width: fit-content;
}

.balance-bar-fill.pawel { background: linear-gradient(90deg, var(--pawel), #7c3aed); }
.balance-bar-fill.seb { background: linear-gradient(90deg, var(--seb), #d97706); }

.balance-total {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.balance-total-item {
    text-align: center;
}

.balance-total-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.balance-total-value {
    font-size: 1.375rem;
    font-weight: 700;
}

.balance-total-value.pawel { color: var(--pawel); }
.balance-total-value.seb { color: var(--seb); }
.balance-total-value.equal { color: var(--accent); }

/* Equilibre indicator */
.equilibre-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.equilibre-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.equilibre-bar-track {
    height: 12px;
    background: var(--bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    display: flex;
    margin-bottom: 0.5rem;
}

.equilibre-bar-left {
    height: 100%;
    background: linear-gradient(90deg, var(--pawel), #7c3aed);
    transition: width 0.6s ease-out;
}

.equilibre-bar-right {
    height: 100%;
    background: linear-gradient(90deg, var(--seb), #d97706);
    transition: width 0.6s ease-out;
}

.equilibre-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
}

.equilibre-legend .pawel { color: var(--pawel); }
.equilibre-legend .seb { color: var(--seb); }

/* Sessions list on stats page */
.stats-sessions {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stats-sessions-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-sessions-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
}

.stats-sessions-list {
    max-height: 400px;
    overflow-y: auto;
}

.stats-session-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.stats-session-item:last-child { border-bottom: none; }

.stats-session-date {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.category-table-wrap {
    overflow-x: auto;
}

.category-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
}

.category-table th,
.category-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: right;
    font-size: 0.8125rem;
}

.category-table th {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg);
}

.category-table td:first-child,
.category-table th:first-child {
    text-align: left;
    font-weight: 600;
}

.category-table tbody tr:hover {
    background: var(--bg-card-hover);
}

/* ============================================
   SITE MENU
   ============================================ */
.site-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 240;
}

.site-menu-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.site-menu-panel {
    position: fixed;
    top: 76px;
    left: 12px;
    width: min(360px, calc(100vw - 24px));
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 0.9rem;
    z-index: 250;
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.site-menu-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.site-menu-group {
    display: grid;
    gap: 0.35rem;
}

.site-menu-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text);
}

.site-menu-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.site-menu-items {
    display: grid;
    gap: 0.25rem;
}

.site-menu-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.site-menu-item:hover {
    background: var(--bg);
    color: var(--text);
}

.site-menu-item.active {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.site-menu-icon {
    width: 20px;
    text-align: center;
}

.site-menu-divider {
    border-top: 1px dashed var(--border);
    margin: 0.55rem 0;
}

/* ============================================
   NAV (legacy)
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
    flex: 1;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.6875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item.active {
    color: var(--accent-dark);
    font-weight: 600;
}

.nav-item:not(.active):hover {
    color: var(--text-secondary);
}

/* Add space for bottom nav */
.app-main {
    padding-bottom: 1.5rem;
}

/* ============================================
   LOADING
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(240, 244, 240, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s;
}

.loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.loading-text {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0;
    transition: all 0.3s ease-out;
    white-space: nowrap;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   DELETE SESSION
   ============================================ */
.session-delete {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.session-delete:hover, .session-delete:active {
    background: var(--danger-light);
    color: var(--danger);
}

.session-delete svg {
    width: 16px;
    height: 16px;
}

.link-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.link-url {
    white-space: normal;
    word-break: break-all;
}

.manual-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.history-panel {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

.history-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.625rem 0.75rem;
    margin-top: 0.5rem;
    background: var(--bg);
}

.history-head {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.history-line {
    font-size: 0.75rem;
    color: var(--text);
    line-height: 1.4;
}

.inline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.hidden {
    display: none;
}

.time-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.time-mode-option {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-secondary);
    padding: 0.625rem 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.time-mode-option input {
    display: none;
}

.time-mode-option.active {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent-dark);
}

@media (max-width: 420px) {
    .extra-filters,
    .inline-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
    .timer-display { font-size: 5rem; }
    .timer-btn { width: 160px; height: 160px; font-size: 1.25rem; }
}
