* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 18px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 72px;
    height: auto;
    object-fit: contain;
}

.brand-text h1 {
    margin: 0;
    font-size: 28px;
    color: #0f172a;
}

.brand-text p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-name {
    font-weight: 600;
    color: #111827;
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s ease;
}

.btn-outline {
    border: 1px solid #ef4444;
    color: #ef4444;
    background: #fff;
}

.btn-outline:hover {
    background: #ef4444;
    color: #fff;
}

.page-content {
    padding: 28px 0 40px;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.section-title {
    margin: 0 0 8px;
    font-size: 24px;
    color: #111827;
}

.section-subtitle {
    margin: 0 0 20px;
    color: #6b7280;
    font-size: 14px;
}

.day-bar {
    width: 100%;
    height: 34px;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
    background: #e5e7eb;
    margin-bottom: 22px;
}

.seg {
    height: 100%;
}

.seg.not-tracked { background: #d1d5db; }
.seg.still       { background: #64748b; }
.seg.slow        { background: #22c55e; }
.seg.fast        { background: #f97316; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
}

.stat-box h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #475569;
    font-weight: 600;
}

.stat-box .time {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.stat-box .perc {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.day-reading {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
}

.week-day {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 10px;
    text-align: center;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.week-day .label {
    font-size: 13px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 10px;
}

.mini-bar-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex: 1;
    min-height: 130px;
}

.mini-bar.empty {
    background: transparent;
    border: 1px dashed #e5e7eb;
}

.mini-bar {
    width: 74px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
    background: #eef2f7;
    border: 1px solid #e5e7eb;
}

.mini-seg {
    width: 100%;
    transition: height 0.25s ease;
}

.mini-seg.still {
    background: #94a3b8;
}

.mini-seg.slow {
    background: #22c55e;
}

.mini-seg.fast {
    background: #f97316;
}

.week-day .note {
    margin-top: 12px;
    font-size: 12px;
    color: #475569;
    min-height: 32px;
}
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.summary-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.summary-box h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #475569;
}

.summary-box .value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.site-footer {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 20px 0;
    margin-top: 20px;
}

.footer-inner {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

.footer-inner p {
    margin: 4px 0;
}

.login-wrap {
    min-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.login-card h2 {
    margin: 0 0 8px;
    font-size: 26px;
    color: #111827;
}

.login-card p {
    margin: 0 0 22px;
    color: #6b7280;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
}

.btn-primary {
    width: 100%;
    border: 0;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@media (max-width: 900px) {
    .stats-grid,
    .summary-grid,
    .week-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-user {
        width: 100%;
        justify-content: space-between;
    }
}




.section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}

.date-picker-box {
    min-width: 180px;
}

.date-picker-box label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.date-picker-box input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    color: #111827;
}

@media (max-width: 900px) {
    .section-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .date-picker-box {
        width: 100%;
    }
}



.chart-box {
    max-width: 260px;
    margin: 0 auto 20px auto;
}


.chart-title {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}



.stat-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    border-top-width: 6px;
}

.stat-not-tracked {
    border-top-color: #d1d5db;
    background: #f9fafb;
}

.stat-still {
    border-top-color: #94a3b8;
    background: #f8fafc;
}

.stat-slow {
    border-top-color: #22c55e;
    background: #f0fdf4;
}

.stat-fast {
    border-top-color: #f97316;
    background: #fff7ed;
}

