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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.5;
}

.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.header .slogan {
    font-size: 14px;
    color: #666;
    margin-top: 6px;
    font-style: italic;
}

.nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 12px;
}

.nav-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #d0d0d0;
    background: #fafafa;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-btn:hover {
    background: #f0f0f0;
    border-color: #b0b0b0;
}

.nav-btn:active {
    transform: scale(0.98);
}

.nav-btn.active {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.15s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #007aff;
}

.form-group input[type="file"] {
    padding: 8px;
    background: #fafafa;
}

.btn-row {
    display: flex;
    gap: 8px;
}

.btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #d0d0d0;
    background: #fafafa;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn:hover {
    background: #f0f0f0;
}

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

.btn.active {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
}

.btn-primary {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-full {
    width: 100%;
}

.btn.red {
    border-color: #ff3b30;
}

.btn.red:hover {
    background: #fff5f5;
}

.btn.red.active {
    background: #ff3b30;
    color: #fff;
}

.btn.green {
    border-color: #34c759;
}

.btn.green:hover {
    background: #f5fff5;
}

.btn.green.active {
    background: #34c759;
    color: #fff;
}

.btn.orange {
    border-color: #ff9500;
}

.btn.orange:hover {
    background: #fffaf5;
}

.btn.orange.active {
    background: #ff9500;
    color: #fff;
}

.toolbar {
    margin-bottom: 16px;
}

.mark-btns {
    display: flex;
    gap: 8px;
}

.seat-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.step-display {
    font-size: 14px;
    color: #666;
    min-width: 80px;
    text-align: center;
}

.history {
    margin-bottom: 16px;
}

#historyList {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#historyList span {
    display: inline-block;
    padding: 4px 10px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

#historyList span:hover {
    border-color: #007aff;
}

#historyList span:active {
    transform: scale(0.95);
}

#historyList span.active {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
}

.classroom {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.podium {
    text-align: center;
    padding: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

#seatsContainer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.seat-row {
    display: flex;
    gap: 8px;
}

.seat {
    width: 70px;
    height: 50px;
    background: #e3f2fd;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.seat:hover {
    background: #bbdefb;
    transform: translateY(-2px);
}

.seat:active {
    transform: scale(0.95);
}

.seat .pos {
    font-size: 10px;
    color: #666;
}

.seat .name {
    font-size: 12px;
    font-weight: 500;
}

.seat.g1 {
    background: #e3f2fd;
}

.seat.g2 {
    background: #fce4ec;
}

.seat.self {
    background: #ffebee !important;
    border-color: #ff3b30;
    border-width: 3px;
}

.seat.want {
    background: #e8f5e9 !important;
    border-color: #34c759;
    border-width: 3px;
}

.seat.dont {
    background: #fff3e0 !important;
    border-color: #ff9500;
    border-width: 3px;
}

.empty {
    width: 70px;
    height: 50px;
}

.report {
    margin-top: 20px;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.report:empty {
    display: none;
}

.report h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 16px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.report h4:first-child {
    margin-top: 0;
}

.report table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.report th, .report td {
    padding: 8px 10px;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 13px;
}

.report th {
    background: #f0f0f0;
    font-weight: 500;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    margin: 10px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.dist-0 { background: #ff3b30; color: #fff; }
.dist-1 { background: #ff9500; color: #fff; }
.dist-2 { background: #ffcc00; color: #333; }
.dist-3 { background: #34c759; color: #fff; }
.dist-4 { background: #007aff; color: #fff; }
.dist-5 { background: #5856d6; color: #fff; }
.dist-other { background: #8e8e93; color: #fff; }

.stats-row {
    display: flex;
    gap: 12px;
    margin: 8px 0;
}

.stat-card {
    flex: 1;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #007aff;
}

.stat-label {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 4px;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.footer p {
    font-size: 13px;
    color: #8e8e93;
}
