:root {
    --bg-main: #0a0e17;
    --bg-card: rgba(17, 24, 39, 0.85);
    --border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-cyan: #38bdf8;
    --accent-red: #ef4444;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    padding-bottom: 3rem;
}

.demo-banner {
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    color: #0f172a;
    padding: 0.5rem 1.5rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.back-link {
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}

.app-wrap {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-icon { font-size: 2.2rem; }

.app-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-demo {
    font-size: 0.75rem;
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.subtext { color: var(--text-muted); font-size: 0.85rem; }

.session-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.stat-val { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; color: var(--accent-emerald); }

.timer-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: center;
}

.timer-display-box {
    text-align: center;
    border-right: 1px solid var(--border);
    padding-right: 1.5rem;
}

.live-timer {
    font-family: var(--font-mono);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.timer-status {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.timer-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group input, .input-row select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.input-group input:focus, .input-row select:focus {
    border-color: var(--accent-cyan);
}

.input-row {
    display: flex;
    gap: 1rem;
}

.input-row select {
    flex: 1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-start {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-stop {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

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

.list-header h2 { font-size: 1.25rem; font-weight: 600; }
.list-actions { display: flex; gap: 0.5rem; }

.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.time-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.time-table th, .time-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.time-table th {
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.badge-tag {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.time-mono { font-family: var(--font-mono); }
.dur-highlight { color: var(--accent-emerald); font-weight: 700; font-family: var(--font-mono); }

.btn-del {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}
.btn-del:hover { color: var(--accent-red); }

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

@media (max-width: 768px) {
    .timer-card {
        grid-template-columns: 1fr;
    }
    .timer-display-box {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 1.5rem;
    }
}
