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

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

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background-color: #0078d4;
    color: white;
    padding: 20px;
}

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

header h1 {
    margin: 0;
    font-size: 28px;
}

.back-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.back-link:hover {
    background-color: rgba(255,255,255,0.3);
}

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

.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;
}

.admin-nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 10px 20px;
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.nav-btn.active {
    background-color: white;
    color: #0078d4;
    border-color: white;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

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

.tab-header h2 {
    color: #333;
    font-size: 24px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls {
    display: flex;
    gap: 10px;
}

.filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.add-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;
}

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

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

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

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

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

.read-only-badge {
    background-color: #fff3cd;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #ffeeba;
}

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

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

.export-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;
}

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

.action-buttons-right {
    display: flex;
    gap: 10px;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

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

thead {
    background-color: #f8f9fa;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

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

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

td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

.actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.edit-btn {
    background-color: #0078d4;
    color: white;
}

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

.delete-btn {
    background-color: #d13438;
    color: white;
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

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

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

.submit-btn {
    width: 100%;
    padding: 12px 20px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

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

/* Submission Control Panel Styles */
.control-panel {
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.control-status {
    margin-bottom: 30px;
}

.control-status h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background-color: white;
    border-radius: 6px;
    border: 2px solid #ddd;
    font-size: 16px;
    font-weight: 500;
}

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ccc;
    transition: background-color 0.3s ease;
}

.status-indicator.open .status-dot {
    background-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.2);
}

.status-indicator.closed .status-dot {
    background-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2);
}

.status-text {
    color: #333;
}

.control-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.control-btn {
    flex: 1;
    padding: 15px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.open-btn {
    background-color: #28a745;
    color: white;
}

.open-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.close-btn {
    background-color: #dc3545;
    color: white;
}

.close-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.control-info {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #0078d4;
}

.control-info h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 12px;
}

.control-info ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
    line-height: 1.8;
}

.control-info li {
    margin-bottom: 8px;
}

.control-badge {
    background-color: #e3f2fd;
    color: #0d47a1;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #bbdefb;
}

.control-timestamps {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.timestamp-item {
    flex: 1;
}

.timestamp-item h4 {
    color: #333;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}

.timestamp-value {
    color: #555;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.auto-close-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.auto-close-section h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
}

.auto-close-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.auto-close-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auto-close-form label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.auto-close-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

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

.schedule-btn {
    flex: 1;
    padding: 10px 20px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

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

.cancel-btn {
    flex: 1;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

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

.scheduled-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    color: #0c5460;
    font-size: 14px;
    font-weight: 500;
}

.scheduled-icon {
    font-size: 18px;
}

.scheduled-text {
    color: #0c5460;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .admin-nav {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
    
    .tab-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
    }
    
    .action-buttons-right {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-controls select {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

/* Success/Error Messages */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.success {
    background-color: #dff6dd;
    color: #107c10;
    border: 1px solid #107c10;
}

.error {
    background-color: #fde7e9;
    color: #d13438;
    border: 1px solid #d13438;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.empty-state-text {
    font-size: 16px;
}

/* Bulk Upload Modal Styles */
.bulk-modal-content {
    max-width: 700px;
}

#bulk-upload-instructions {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #0078d4;
}

#bulk-upload-instructions p {
    margin-bottom: 10px;
}

#bulk-upload-instructions p:last-child {
    margin-bottom: 0;
}

#csv-format-example {
    background-color: white;
    padding: 10px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin: 10px 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.upload-results {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.upload-results.success {
    background-color: #dff6dd;
    color: #107c10;
    border: 1px solid #107c10;
    display: block;
}

.upload-results.error {
    background-color: #fde7e9;
    color: #d13438;
    border: 1px solid #d13438;
    display: block;
}

.upload-results h4 {
    margin-bottom: 10px;
}

.upload-results ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.upload-results li {
    margin-bottom: 5px;
}

/* Clear Modal Styles */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

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

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

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

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

.send-to-previous-btn {
    padding: 10px 20px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.send-to-previous-btn:hover {
    background-color: #005a9e;
}
