.attendance-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.connection-error {
    background: #ffebee;
    color: #c62828;
    padding: 14px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 5px solid #c62828;
    font-size: 15px;
}

.attendance-header {
    margin-bottom: 25px;
}

.header-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.header-item {
    flex: 1;
    min-width: 220px;
}

.header-item label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.header-item input, .header-item button {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
}

.attendance-table {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 60px 1fr 180px;
    background: #1e5f74;
    color: white;
    font-weight: bold;
}

.table-header > div {
    padding: 12px;
    text-align: center;
}

.table-body {
    max-height: 450px;
    overflow-y: auto;
}

.student-row {
    display: grid;
    grid-template-columns: 60px 1fr 180px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.row-number {
    text-align: center;
    background: #f5f5f5;
    padding: 12px;
    font-weight: bold;
}

.row-name {
    padding: 10px;
    position: relative;
}

.row-name input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.suggestions {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    width: calc(100% - 20px);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.suggestions.show { display: block; }

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:hover { background: #f8f8f8; }

.row-status select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
}

.attendance-footer {
    margin-top: 20px;
    text-align: right;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-left: 10px;
}

.btn-check { background: #1e5f74; color: white; }
.btn-clear { background: #e53935; color: white; }
.btn-submit { background: #43a047; color: white; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show { display: flex; }

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}

.loading { text-align: center; padding: 30px; color: #666; }

/* Responsive */
@media (max-width: 768px) {
    .header-row { flex-direction: column; }
    .table-header, .student-row { grid-template-columns: 50px 1fr 140px; }
}