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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    color: #333;
    font-size: 24px;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.debug-link {
    padding: 8px 16px;
    background-color: #17a2b8;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.debug-link:hover {
    background-color: #138496;
}

.admin-link {
    padding: 8px 16px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.admin-link:hover {
    background-color: #5a6268;
}

.input-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

.input-group select,
.input-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.input-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #666;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0,120,212,0.2);
}

.submit-btn {
    padding: 10px 20px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    min-width: 120px;
}

.submit-btn:hover {
    background-color: #005a9e;
}

.submit-btn:active {
    background-color: #004578;
}

.refresh-btn {
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    min-width: 120px;
    transition: background-color 0.3s ease;
}

.refresh-btn:hover {
    background-color: #5a6268;
}

.logout-btn {
    padding: 8px 16px;
    background-color: #d13438;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #a80000;
}

.submission-status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
}

.status-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 4px;
}

.status-alert.closed {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.status-icon {
    font-size: 20px;
}

.status-text {
    font-size: 14px;
    font-weight: 500;
}

.download-btn {
    padding: 10px 20px;
    background-color: #107c10;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: #0b5c0b;
}

.download-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.table-section {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead {
    background-color: #0078d4;
    color: white;
}

th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #005a9e;
    position: relative;
}

/* Make columns 4-9 narrower with text wrapping */
th:nth-child(4),
th:nth-child(5),
th:nth-child(6),
th:nth-child(7),
th:nth-child(8),
th:nth-child(9) {
    max-width: 100px;
    white-space: normal;
    word-wrap: break-word;
    font-size: 11px;
}

td:nth-child(4),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7),
td:nth-child(8),
td:nth-child(9) {
    max-width: 100px;
    white-space: normal;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}

/* Make Type column (column 13) visible with proper styling */
td.type-cell {
    max-width: 80px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: #0078d4;
    text-align: center;
}

th:nth-child(13) {
    max-width: 80px;
    white-space: normal;
    word-wrap: break-word;
    font-size: 11px;
}

/* Make columns 10-12 narrower for spike inputs */
td:nth-child(10),
td:nth-child(11),
td:nth-child(12) {
    max-width: 80px;
}

td:nth-child(10) input,
td:nth-child(11) input,
td:nth-child(12) input {
    width: 100%;
    max-width: 80px;
}

th .sort-icon {
    margin-left: 5px;
    cursor: pointer;
}

tbody tr {
    border-bottom: 1px solid #ddd;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

td {
    padding: 10px 8px;
    border: 1px solid #ddd;
}

tbody td input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

tbody td input:focus {
    outline: none;
    border-color: #0078d4;
}

.readonly-cell {
    background-color: #f0f0f0;
    color: #666;
}

.editable-cell {
    background-color: white;
}

.total-spike {
    font-weight: bold;
    color: #0078d4;
}

@media (max-width: 768px) {
    .header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .input-group {
        width: 100%;
    }
    
    .submit-btn {
        width: 100%;
    }
}
