/* ============================================================
   Sprint Scope Creep Tracker — Styles
   Clean professional light mode with blue/orange accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --committed: #3B82F6;
    --added: #F97316;
    --done: #22C55E;
    --deferred: #94A3B8;
    --bg: #F8FAFC;
    --bg-white: #FFFFFF;
    --bg-surface: #F1F5F9;
    --bg-hover: #E2E8F0;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --primary: #3B82F6;
    --danger: #EF4444;
    --warning: #F59E0B;
    --success: #22C55E;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, .07);
    --transition: 200ms ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

.header {
    text-align: center;
    padding: 28px 0 20px;
}

.header-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.header p {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.btn:hover {
    background: var(--bg-surface);
}

.btn:active {
    transform: scale(.97);
}

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

.btn-primary:hover {
    opacity: .9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: .8rem;
}

.btn-danger {
    background: rgba(239, 68, 68, .06);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-warning {
    background: rgba(249, 115, 22, .06);
    border-color: var(--added);
    color: var(--added);
}

.toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* --- Creep Status Badge --- */
.creep-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 700;
}

.creep-status.green {
    background: rgba(34, 197, 94, .1);
    color: var(--success);
}

.creep-status.yellow {
    background: rgba(245, 158, 11, .1);
    color: var(--warning);
}

.creep-status.red {
    background: rgba(239, 68, 68, .1);
    color: var(--danger);
}

/* --- Sprint Info Cards --- */
.sprint-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: .7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 4px;
}

/* --- Item List --- */
.item-list {
    margin-bottom: 20px;
}

.item-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    box-shadow: var(--shadow);
}

.item-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.item-badge.committed {
    background: rgba(59, 130, 246, .1);
    color: var(--committed);
}

.item-badge.added {
    background: rgba(249, 115, 22, .1);
    color: var(--added);
}

.item-badge.done {
    background: rgba(34, 197, 94, .1);
    color: var(--done);
}

.item-badge.deferred {
    background: rgba(148, 163, 184, .1);
    color: var(--deferred);
}

.item-title {
    font-weight: 600;
    font-size: .9rem;
}

.item-points {
    font-weight: 800;
    font-size: .9rem;
    color: var(--text-secondary);
}

.item-date {
    font-size: .75rem;
    color: var(--text-muted);
}

.item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .85rem;
    padding: 4px;
    color: var(--text-muted);
    transition: color var(--transition);
}

.item-actions button:hover {
    color: var(--text-primary);
}

/* --- Chart --- */
.chart-container {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.chart-title {
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: 10px;
}

.chart-canvas {
    width: 100%;
    height: 140px;
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .3);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 440px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .85rem;
    outline: none;
    margin-bottom: 10px;
}

.modal-input:focus {
    border-color: var(--primary);
}

.modal-label {
    font-size: .8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 2px;
}

/* --- Progress Bar --- */
.progress-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-surface);
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 500ms ease;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: .85rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
    z-index: 200;
}

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

@media (max-width: 768px) {
    .item-row {
        grid-template-columns: auto 1fr auto;
    }

    .item-date,
    .item-actions {
        display: none;
    }

    .sprint-stats {
        grid-template-columns: 1fr 1fr;
    }
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}