:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --bg: #f8f9fa;
    --card: #ffffff;
    --text: #333;
    --gray: #7f8c8d;
    --success: #27ae60;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 { margin: 0 0 1rem 0; font-size: 1.2rem; }

nav { display: flex; justify-content: center; gap: 0.5rem; }
.nav-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}
.nav-btn:active { background: rgba(255,255,255,0.3); }

.page { padding: 1rem; max-width: 600px; margin: 0 auto; }

.summary-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    margin-bottom: 1.5rem;
}
.stat-row { display: flex; justify-content: space-around; margin-bottom: 1rem; }
.stat-box { display: flex; flex-direction: column; }
.stat-box .label { font-size: 0.8rem; color: var(--gray); }
.stat-box .value { font-size: 1.5rem; font-weight: bold; color: var(--primary); }
.last-updated { font-size: 0.7rem; color: var(--gray); margin: 0; }

.action-area { text-align: center; margin-bottom: 2rem; }
.main-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
}

.list { display: grid; gap: 0.75rem; }
.card {
    background: var(--card);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.card-info h4 { margin: 0; font-size: 1rem; }
.card-info p { margin: 0; font-size: 0.8rem; color: var(--gray); }
.badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    background: #eee;
}
.badge.visited { background: var(--success); color: white; }

.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search-bar input { flex: 1; padding: 0.6rem; border: 1px solid #ddd; border-radius: 8px; }
.search-bar select { padding: 0.6rem; border: 1px solid #ddd; border-radius: 8px; }

.filter-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tab {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
}
.tab.active { background: var(--accent); color: white; border-color: var(--accent); }

.stats-list { display: grid; gap: 0.5rem; }
.stat-item {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent);
}
.progress-bar {
    width: 100px;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill { height: 100%; background: var(--success); }

.settings-group {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.sec-btn {
    background: #eee;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
}

.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 20px;
    position: relative;
}
.close { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; cursor: pointer; }

.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.8rem; color: var(--gray); }
.form-group input, .form-group textarea {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}
.checkbox-group { display: flex; gap: 1rem; margin-bottom: 1rem; }
.test-result {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #eee;
    font-size: 0.7rem;
    border-radius: 5px;
    white-space: pre-wrap;
    word-break: break-all;
}
